I am getting
TypeError: $(…).tooltip is not a function
error in the jquery file in which i am initialising tooltip() function while using lightbox2 with bootstrap.
$(function() {
$('[data-toggle="tooltip"]').tooltip({
html: true
});
});
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="main.js"></script>
</head>
<body>
<script src="lightbox-plus-jquery.min.js"></script>
</body>
This can happen when jQuery is included twice.
For people using Rails, jQuery is already included by default (check app/assets/javascripts/application.js
):
//= require jquery
Including jQuery again, for example with a <script>
tag in app/views/layouts/application.html.erb
, will result in this error.
The solution is to remove the <script>
tag in app/views/layouts/application.html.erb
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With