There is no processing of the live function after the jquery version is updated. TypeError: $ (...). Live is not a function

Source: Internet
Author: User

jquery Live function syntax

jquery version update, found a problem: JQ comes with live no more.
The following prompts are available under the console:
Firefox: TypeError: $ (...). Live is not a function

Chrome:uncaught Typeerror:object [Object Object] has no method ' live '

A statement on the Internet:
JQuery 1.9 has made a lot of adjustments compared to previous versions, and many functions are not supported.
For example, Live (), die (), toggle (), sub (), $.browser, and so on have been removed and the full update is shown in http://jquery.com/upgrade-guide/1.9/(English).

Without changing your site code, you will need to use jQuery Migrate (transfer, over) to use the version after 1.9, see http://blog.jquery.com/2013/01/31/ jquery-migrate-1-1-0-released/(English).
The Migrate should only be temporary. To stay in sync with jQuery, it is recommended that you rewrite all of your site's code from now on with 1.9 changes.
So before your code if it's
$ ("#ele"). Live ("Click", Function () {
//...
});
Now to write
$ ("#ele"). On ("click", Function () {
//...
});
Dynamically generated elements to use live, to be written as
$ (document). On ("click", "#ele", function () {
//...
});

There is no processing of the live function after the jquery version is updated. TypeError: $ (...). Live is not a function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.