Side navigation
#13220 closed bug (duplicate)
Opened January 15, 2013 04:59PM UTC
Closed January 15, 2013 08:51PM UTC
Last modified April 18, 2013 07:35PM UTC
jQuery 1.9.0 .live('click')
Reported by: | djsucho@gmail.com | Owned by: | djsucho@gmail.com |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.0 |
Keywords: | dbr | Cc: | |
Blocked by: | Blocking: |
Description
jQuery 1.9.0
.live('click', function() { });
console: Uncaught TypeError: Object [object Object] has no method 'live'
Attachments (0)
Change History (15)
Changed January 15, 2013 05:02PM UTC by comment:1
owner: | → djsucho@gmail.com |
---|---|
status: | new → pending |
Changed January 15, 2013 05:18PM UTC by comment:2
Hi, sorry for my English
released a new version of jQuery 1.9.0 and suddenly everything where I used function
.live ('click', function () {}); stopped working
console: Uncaught TypeError: Object [object Object] has no method 'live'
when by change an old jQuery 1.8.3 everything works
jSfidle jQuery 1.8.3 http://jsfiddle.net/qsXeD/
on 1.9.0 alert not pop
Changed January 15, 2013 08:25PM UTC by comment:3
I believe .live() has been moved from 1.9 to the migrate plugin
Changed January 15, 2013 08:51PM UTC by comment:4
resolution: | → duplicate |
---|---|
status: | pending → closed |
Duplicate of #13213.
Changed January 16, 2013 04:55PM UTC by comment:5
HOW CAN YOU FUCKERS RELEASE A VERSION WITH SUCH A MAJOR FAULT!?!??!
Changed January 16, 2013 05:16PM UTC by comment:6
keywords: | → dbr |
---|
Changed January 16, 2013 05:33PM UTC by comment:7
According to the API documentation for the live method:
It was deprecated in version 1.7. That version was officially released on November 3, 2011
http://blog.jquery.com/2011/11/03/jquery-1-7-released/
You've had over a year to prepare for the removal of live. You can of course continue to use a previous version.
Changed January 16, 2013 05:42PM UTC by comment:8
I think we've done a pretty good job getting the message out over the past year with blog posts, upgrade guides, and the jQuery Migrate plugin.
Most likely the affected people were either using http://code.jquery.com/jquery-latest.js or http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js in their production sites and therefore had the upgrade forced on them. **Using these URLs is a very bad idea.**
There will always be breaking changes, intentional and unintentional, between versions of software. If you've tested your site and jQuery plugins with version 1.8.3 or some other version then you should stay on that version until you have the time to read the new docs, upgrade, and test again with 1.9.0. By saying "I want the latest version" on a production site you're playing reliability roulette and the house always wins.
Changed January 16, 2013 07:47PM UTC by comment:9
Guys, please realize that this change has huge implications on a vast number of projects. There are not just individual developers who need to modify their codes, but a large number of third party companies and plugin/library providers are also behind.
For example, this morning, after upgrading to version 1.9.0 in our development environment, all of our ASP.NET MVC projects stopped working, not because WE are using "live", but because this function is used even in the latest versions of MIcrosoft's unobtrusive plugins such as "jquery.unobtrusive-ajax.js". So now we are reverting back our update until sometime Microsoft and who knows what other third-party companies gradually convert their products according to this change.
Changed January 16, 2013 07:51PM UTC by comment:10
_comment0: | @anonymous, we've been working towards this for a year and publicizing it all on blog posts and documentation. Where were you to register your feedback during that time? \ \ As you've done, you can continue to use 1.8.3 while your other project dependencies catch up. Clearly we can't just stop making releases and changing things until everyone catches up. We'd never release anything. → 1358366042105683 |
---|
@anonymous, we've been working towards this for a year and publicizing it all on blog posts and documentation. Where were you to register your feedback during that time?
As you've done, you can continue to use 1.8.3 while your other project dependencies catch up. Alternatively you should be able to use the jQuery Migrate plugin to restore the old functionality. That is its purpose.
Clearly we can't just stop making releases and changing things until everyone catches up. We'd never release anything.
Changed January 16, 2013 07:53PM UTC by comment:11
...or you can write the one line of code to re-add .live()
...
Changed January 16, 2013 08:21PM UTC by comment:12
Replying to [comment:10 dmethvin]:
@anonymous, we've been working towards this for a year and publicizing it all on blog posts and documentation. Where were you to register your feedback during that time? As you've done, you can continue to use 1.8.3 while your other project dependencies catch up. Alternatively you should be able to use the jQuery Migrate plugin to restore the old functionality. That is its purpose. Clearly we can't just stop making releases and changing things until everyone catches up. We'd never release anything.
Don't get me wrong my friend. I appreciate all your hard work, contribution to the community, and so many wonderful innovations. - And yes, I for one have not provided any feedback and contribution to this project whatsoever, but generally, unfortunately this kind of change requires a huge coordination effort, especially for something like jQuery which is now an important part of any non-trivial web-based application. Well, now we'll have to wait and see how this goes and learn some lessons from it for our future. - In any case I would like to thank you guys so much for all your precious and invaluable contributions and efforts.
Changed January 17, 2013 12:33AM UTC by comment:13
The migrate plugin keeps .live() around for you. Sorry, there's just too many ways around this to take these complaints seriously.
Changed February 22, 2013 07:05AM UTC by comment:14
What are we supposed to use instead of live? I've seen people say to use "on" instead, however this isn't working for me for what live worked for (elements that were not originally on the page but are dynamically put there)
Changed April 18, 2013 07:35PM UTC by comment:15
Apparently it is very easy to fix the error in "jquery.unobtrusive-ajax.js". Simply replace all calls to live function using following pattern:
old:
$("form[data-ajax=true]").live("submit",function (evt) { }
new:
$(document).on("submit","form[data-ajax=true]",function (evt) { }
For more information go to:
http://www.elijahmanor.com/2012/02/differences-between-jquery-bind-vs-live.html
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.
To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.
Also, please read: http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/