$(...) is null

刪衝突插件,jquery做爲基礎庫,固然是沒有理由被刪了。這個方法最直接了。jquery

(2)將jquery的$方法更名,具體更名方法以下:
this

jQuery.noConflict();//將變量$的控制權讓渡給給其餘插件或庫 
jQuery(function(){//不在直接使用$,而是使用jQuery 
    jQuery("p").click(function(){ 
        alert( jQuery(this).text() ); 
    }); 
});
相關文章
相關標籤/搜索