问题
I am facing some error with twitter bootstrap popover example
HTML
<h1>Popover</h1>
<a href="#" id="example" class="btn btn-primary" rel="popover"
data-content="This isthe body of Popover"
data-original-title="Creativity Tuts">
</a>
Included Script Tags
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
src="js/bootstrap.js"
src="js/Tooltip.js"
src="js/Popover.js"
My JavaScript
$(function() {
$('example').popover();
});
I downloaded the following libraries:
- bootstrap.js
- bootstrap.min.js
- popover.js
- tooltip.js
But the code still does not work
回答1:
example is the id or the target element, so you need to use id selector(prefix #). Your selector(element selector) looks for an element with tag name example like <example ...>...</example>
$('#example').popover();
来源:https://stackoverflow.com/questions/19498770/twitter-bootstrap-popover-error