Bài đăng

Đang hiển thị bài đăng từ tháng 11 25, 2014

Avoiding Conflicts with Other Libraries Nguồn http://learn.jquery.com/

The jQuery library and virtually all of its plugins are contained within the  jQuery  namespace. As a general rule, global objects are stored inside the jQuery namespace as well, so you shouldn't get a clash between jQuery and any other library (like prototype.js, MooTools, or YUI). That said, there is one caveat:  by default, jQuery uses  $  as a shortcut for  jQuery .  Thus, if you are using another JavaScript library that uses the  $  variable, you can run into conflicts with jQuery. In order to avoid these conflicts, you need to put jQuery in no-conflict mode immediately after it is loaded onto the page and before you attempt to use jQuery in your page. link Putting jQuery Into No-Conflict Mode When you put jQuery into no-conflict mode, you have the option of assigning a new variable name to replace the  $  alias. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <!-- Putting jQuery into no-conflict mode. --> < scrip