2012-12-15 37 views

回答

0

當你有其他庫使用jQuery一起,你可以使用jQuery.noConflict()功能,避免與jQuery page和怎麼樣$

樣品的常用符號衝突使用noConflict()

<script type="text/javascript" src="other_lib.js"></script> 
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript"> 
    $.noConflict(); 
    jQuery(document).ready(function($) { 
    // Code that uses jQuery's $ can follow here. 
    }); 
    // Code that uses other library's $ can follow here. 
</script> 

的想法是,你打電話後$.noConflict();然後將jQuery庫中的所有REST調用使用jQuery,而不是完成象徵上面的例子。

相關問題