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;
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
Count jquery deprecated functions