2

I am getting this error.

Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher

And I update the version into 2.1.3 that is

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

And I get this error:

TypeError: $(...).live is not a function

I don't know how to solve this issue. Please suggest me.

Sunil Shrestha
  • 208
  • 1
  • 4
  • 13

2 Answers2

2

Live is deprecated from 1.7 and removed from 1.9 Just use on or delegate.

$( "[selector]").on("events" [, selector ] [, data ], function() {
   ....
});
Sagi
  • 8,972
  • 3
  • 33
  • 41
1

Replace in your code .live() by .on() :

$( selector ).live( events, data, handler );                // jQuery 1.3+
$( document ).delegate( selector, events, data, handler );  // jQuery 1.4.3+
$( document ).on( events, selector, data, handler );        // jQuery 1.7+


$( "a.offsite" ).live( "click", function() {
  alert( "Goodbye!" ); // jQuery 1.3+
});
$( document ).delegate( "a.offsite", "click", function() {
  alert( "Goodbye!" ); // jQuery 1.4.3+
});
$( document ).on( "click", "a.offsite", function() {
  alert( "Goodbye!" );  // jQuery 1.7+
});

Source : http://api.jquery.com/live/

You can try to update Bootstrap to the lastest version too.

Nicolapps
  • 819
  • 13
  • 29