2012-10-18 135 views
0

我正在使用圖像上傳Plupload,它導致與我在我的網頁上的其他jQuery的錯誤。我已經想通了,什麼部分是這樣做:plupload搞砸jquery

function $(id) { 
    return document.getElementById(id); 
} 

如果我藉此走出圖片上傳不再工作,但jQuery不會。這是很多代碼發佈在這裏,有沒有人有另一種方式來調用這個函數,以便它與jQuery的工作?預先感謝您的幫助。

回答

2

使用jQuery這樣的:

jQuery(function($){ 
    //Your jQuery code here 
    // Use $ alias worry-free of conflicts 
    alert('You are using jQuery ' + $().jquery); 
}); 

(function($){ 
    //Your jQuery code here 
})(jQuery); 

$.noConflict(); 
jQuery(document).ready(function($) { 
    // Code that uses jQuery's $ can follow here. 
}); 
// Code that uses other library's $ can follow here. 

var j = jQuery.noConflict(); 
// Do something with jQuery 
j("div p").hide(); 
// Do something with another library's $() 
$("content").style.display = 'none'; 
+1

你amaz ING!謝謝sooo多:) – liveandream

+1

不客氣,我個人更喜歡用第二或第四個例子。 –