2012-10-18 91 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

不客气,我个人更喜欢用第二或第四个例子。 –