简体   繁体   English

Plupload弄乱了jquery

[英]Plupload messing up jquery

I am using the image uploader Plupload and it is causing errors with the other jquery I have on my page. 我正在使用图像上传器Plupload,它导致我的页面上的其他jquery出错。 I have figured out exactly what part is doing it: 我已经弄清楚到底在做什么:

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

If I take this out the image uploader no longer works but the jquery does. 如果我把它拿出来,图像上传器不再有效,但是jquery可以。 It is a lot of code to post here, does anyone have another way to call this function so that it works with jquery? 这里发布了很多代码,有没有人有另一种方法来调用这个函数,以便它可以与jquery一起使用? Thanks in advance for any help. 在此先感谢您的帮助。

use jQuery like this: 像这样使用jQuery:

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

or 要么

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

or 要么

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

or 要么

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM