Problem with jquery 1.7

Yesterday one of my sites stopped working and I started looking for a problem. Started with the console and saw, that swearing goes to code like the following:

$(selector).live(events, data, handler);

And the problem was precisely that there were changes in the old version of jquery, namely in the version 1.7. I learned from official sources that .live() has been replaced by .on() and that this action is deprecated. Although before that the site worked fine and no matter how the old version of jquery should not change. A little later the next day. site I saw a line version deprecated: 1.7, removed: 1.9.

The problem was solved replacing one version of the library jquery 1.7 to another jquery 1.9 and in the new method .on() no longer worked, but the method worked fine .live() about which they wrote, that it is outdated. We will follow these methods., It's possible, something else will change.

The article was written by me for those developers who are in my community as a warning “Check your sites, especially where used. ajax“.

In connection with this problem, I open a new section, where you can publish your problems and their solution in the development of sites I call the section “Problems and Solutions”.

The request of all who read and faced a similar problem, somehow comment on it.

Nikolaenko Maxim

Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


You may also like...

1 Response

  1. Alexey Gor says:

    here is what the documentation says

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

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

    I.e. in version 1.9 need to use .on()
    In earlier versions it is highly recommended to use delegate()
    instead of live().
    To make your life easier, just use on() for version 1.7 and children

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Templates for WordPress
The best hosting in Ukraine
Stable hosting for Drupal