jQuery live() works with jQuery 1.8.3 & below but not with 1.9.1 or 2.0 -


i've been using http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js while , has been fine, 1.8.3 got quite old i've decided move latest jquery. , few things stopped working: quicksand plugin , part of own jquery code (that shows additional data under every slide of slider).

can me figuring out what's wrong? or maybe it's not worth moving jquery versions above 1.8.3? check jsfiddle.

html:

<a href="#" class="show" data-show="first">show</a> <a href="#" class="show" data-show="second">show</a>  <div id="first">first paragraph.</div> <div id="second">second paragraph</div> 

js:

jquery(".show").live("click", function (e) {     var slide = '#' + jquery(this).data('show');     jquery(slide).slidetoggle();     e.preventdefault(); }); 

css:

div { display: none; } 

here's working jsfiddle: http://jsfiddle.net/abrna/

try changing jquery 1.9.1 or 2.0 , hit run. script stops working. why?

the .live() method has been deprecated since jquery 1.7 , has been removed in 1.9.

http://jquery.com/upgrade-guide/1.9/#live-removed


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -