Hi there,
I have a working installation of XUpload, but I want to incorporate the jQuery javascript framework on my page. However there is a conflict with the xupload.js, I think it is because I use the following jQuery recommended method to activate jQuery elements...
$(document).ready(function(){ *my jquery code here* }
Is there a way of modifying the xupload.js file so they play nice together?
XUpload - Integration with jQuery framework
-
- Posts: 9
- Joined: Jun 05, 2007 5:34 pm
If I comment out...
At the start of the xupload.js, then my jQuery scripts all start to work as expected and the files upload to my server OK, but the upload progress box does not refresh/update at all.
Code: Select all
function $(elem){return document.getElementById(elem);}
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
-
- Posts: 9
- Joined: Jun 05, 2007 5:34 pm
Solved!
OK, PilgrimX182 found a solution for this conflict as follows...
In the xupload.js file rename function (1st line) to:
Then automatically replace all $ in xupload.js with $gget and it will be all right.
In the xupload.js file rename function (1st line) to:
Code: Select all
function $gget(elem){return document.getElementById(elem);}
same problem with mootools
has anyone had any luck integrating with mootools?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Re: Solved!
i got the new xupload pro version and i was trying to integrate with drupal which uses jquery. I renamed the xupload.js $ function to $$. I also had to modify upload.cgi. Instead of naming my function $gget like PilgrimX182 mentioned, i named it $$. So my upload.cgi looks like so:philwareham wrote:OK, PilgrimX182 found a solution for this conflict as follows...
In the xupload.js file rename function (1st line) to:
Then automatically replace all $ in xupload.js with $gget and it will be all right.Code: Select all
function $gget(elem){return document.getElementById(elem);}
Code: Select all
if($ENV{QUERY_STRING} =~ /^settings/)
{
$c->{pass_required} = $c->{upload_password}&&1;
print"Content-type: text/html\n\n";
print"$_='$c->{$_}';" for qw(ext_allowed ext_not_allowed max_upload_files max_upload_size enable_file_descr pass_required email_required);
print qq[if(\$\$('x_max_files'))\$\$('x_max_files').innerHTML = '$c->{max_upload_files}';];
print qq[if(\$\$('x_max_size'))\$\$('x_max_size').innerHTML='$c->{max_upload_size}';];
print q[if($$('x_password')){$$('x_password').style.display='block';}] if $c->{pass_required};
print q[if($$('x_folder')){$$('x_folder').style.display='block';}] if $c->{allow_ext_folder};
exit;
}
-
- Posts: 8
- Joined: Mar 23, 2011 7:20 pm
Re: Solved!
Thank you! That works great!wfrohwein wrote:I renamed the xupload.js $ function to $$. I also had to modify upload.cgi.
Fix the source?
While I adore open source so I can fix things myself...
jQuery is mad popular -- why not replace all the $() to $$() in an official release, especially for us who purchased Pro?
jQuery is mad popular -- why not replace all the $() to $$() in an official release, especially for us who purchased Pro?