Take stock of jquery deprecated functions

Source: Internet
Author: User
Tags deprecated

Earlier for better browser compatibility, has been using the jQuery-1.7.2 version, but with the rapid development of the major browsers and technologies, even bootstrap new version is required to introduce jQuery-1.9 more than the version, representing the common jQuery-1.7.2 also should say goodbye to the historical stage;

650) this.width=650; "alt=" jquery.jpg "src=" http://www.baijunyao.com/Upload/image/ueditor/20150426/ 1429980345483424.jpg "title=" 1429980345483424.jpg "/>

But some of our commonly used functions are discarded, and if you do not pay attention to them, you will be able to take stock of these discarded functions; Of course, if you do not know the introduction of these discarded functions; Congratulations, you don't have to remember, you just have to understand the alternative function. The significance of this article is to remind the pro of which functions are deprecated and which functions to replace; for the specific use of alternative functions please Gotodo Niang.

1:

Deprecated functions:. Live ()

Deprecated version: jQuery-1.9 or more

Alternative functions:. On ()

2:

Deprecated functions:. Die ()

Deprecated version: jQuery-1.9 or more

Alternative functions:. Off ()


3: Deprecated function:. Size ()

Deprecated version: jQuery-1.8 or more

Alternate function:. length


4: Deprecated function:. Toggle ()

Deprecated version: jQuery-1.8 or more

Alternative functions: ...


Fortunately, when writing this article to throw this function to the end, because the official does not have the corresponding substitution function, but nothing can block the programmer who owns wisdom;

If it is used to toggle CSS styles, you can use. Toggleclass ();

If you want to switch events, you can use the following custom functions;

var i=0;      $ (' #test '). Click (function () {if (i==0) {//Execute method content I=1;      }else{//Execution method content i=0; }  }


This article for Bai Jun Remote original article, reprinted without contact with me, but please specify from Bai Jun remote blog baijunyao.com


This article is from the "Bai Jun Remote Blog" blog, please be sure to keep this source http://shuaibai123.blog.51cto.com/10163353/1639515

Take stock of jquery deprecated functions

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.