Mommy look.. Upgrading jQuery breaks live :(

Mommy look.. Upgrading jQuery breaks live :(

If you have upgraded jQuery to 1.9 then you would have dreaded Uncaught TypeError: undefined is not a function would be barking at you on your javascript console.

The fix
According to the jQuery site, you would need to replace live with on

Say if you have:

$('.selector-class-name').live('click', function(){console.log('
Applications programming is a race between software engineers, who strive to produce idiot-proof programs, and the universe which strives to produce bigger idiots. So far the Universe is winning.
Rick Cook
')});

Then you would have to change this to the new version using on as follows.
*The current on will be passed the event owner as a parameter so, we have to have a way to know the parent of the event owner, in this case the object with class selector-class-name.
If we don’t know the parent we can implement body tag

$('parent-of-object').on('click', '.selector-class-name', function(){
Applications programming is a race between software engineers, who strive to produce idiot-proof programs, and the universe which strives to produce bigger idiots. So far the Universe is winning.
Rick Cook
});

This shall take care of the problem.

spring upload multiple files

You don’t have permission to access / on this server. Apache error

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

Check if Function Exists in Javascript

AbstractSureFireMojo Class Missing Maven Surefire

Spring Data error: getOutputStream() has already been called for this response

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*