Tagged: jQuery
-
AuthorPosts
-
December 10, 2013 at 3:15 pm #198549
I include on my page uploadify js plugin to uploading files using ajax (exactly jQuery) but I cant using any jQuery code on page becouse there will be error “$ is not a function” so propably function $ is overwrited. I change initialization code from
$(function() {
to
jQuery( document ).ready(function( $ ) {
but it still not working (including uploadify js have the same problem ?)Question 1. How to exclude files that overwriting that function in js and if you know write me filenames.
Question 2. Do you know any solution for that ? Tried jQuery.noConflict and a lot of others solution and still not working.December 10, 2013 at 8:03 pm #198680Hi AdFX!
Have you tried simply changing that to:
jQuery(function() {
Can you post a link to your website?
Cheers!
JosueDecember 11, 2013 at 11:19 am #198945Hi, yes i tried a lot of diffrent ways to make that uploadify script working, now i put you way and it placed in that adress:
http://ad.kinefi.pl/zamowienie
there is a test adress with the same code and it work http://ad.kinefi.pl/test/uploadify/give me a way to solve that please
December 11, 2013 at 11:23 am #198952Hi!
Wrap your js code into a self executing function like
(function($) { //my code })(jQuery);
and you can use the $ shortcode with the noconflict mode. I.e. in your case the code looks like
jQuery(function() { $('#file_upload').uploadify({ 'formData' : { 'timestamp' : '1386753645', 'token' : '853cbd34cf4daf06b176c2ec1b170279' }, 'progressData' : 'speed', 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php' }); $('.customize_input_text').live("keyup", function(){ count_chars($(this)); }) });
replace it with
(function($) { $(function() { $('#file_upload').uploadify({ 'formData' : { 'timestamp' : '1386753645', 'token' : '853cbd34cf4daf06b176c2ec1b170279' }, 'progressData' : 'speed', 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php' }); $('.customize_input_text').live("keyup", function(){ count_chars($(this)); }); }); })(jQuery);
Regards,
PeterDecember 12, 2013 at 10:24 am #199417Thanks for you reply Peter but that solution isn’t work :( Now i have in error console two errors:
Error: TypeError: $(...).uploadify is not a function Source File: http://ad.kinefi.pl/zamowienie Line: 186
and (which i think is results from the above)
Error: TypeError: c is undefined Source File: http://ad.kinefi.pl/wp-content/themes/enfold/uploadify/jquery.uploadify.min.js Line: 16
so propably $ is not recognized properly as before :( please, give me some solution for that.
Have a nice day Peter
December 12, 2013 at 3:56 pm #199510Hi!
I see no obvious reason for this js error – maybe try to deactivate the jquery updater plugin which seems to replace the default (bundled) jquery script with a custom script. If this doesn’t solve the issue I recommend to hire a freelancer from http://www.microlancer.com/ who has more time to tinker around with your code and to investigate the issue.
Best regards,
Peter -
AuthorPosts
- The topic ‘Problem with jQuery’ is closed to new replies.