Hooch Posted November 6, 2011 Share Posted November 6, 2011 Howdy all. I have 2 scripts that are not happy with each other. From what I have googled there are functions that are named the same. So my limited knowledge of JS have brought me to the conclusion the 2 scripts have function( c ) and function(e) in common.There are 4 function's in this code at the beginning. But do I need to sift through all that code after these functions and replace all the c's and e's?I'm not even sure what I need to change amongst the 1st 4 functions since there are many c's and e's there too. Here is the first bit of code on the file (I can't post the whole code since IPBoard thinks I'm posting a bunch of emoticons)jquery-pack.js eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(' There you can see the functions I am dealing with...after this code it's a bunch of gobbledee gook to me. Thank you for your time Link to comment Share on other sites More sharing options...
boen_robot Posted November 6, 2011 Share Posted November 6, 2011 Do you have uncompressed versions of those files (this one is obviously packed by "packer").Are both scripts yours? If so, have you considered namespacing them (i.e. placing all functions of each script under an object named after the library)? Link to comment Share on other sites More sharing options...
Hooch Posted November 6, 2011 Author Share Posted November 6, 2011 These are scripts I have picked up from the net.One is from code I have purchased. The "packer" is from code I downloaded from http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop/ I am completely lost with JS and do not understand what you want me to do when it comes to namespacing. Link to comment Share on other sites More sharing options...
thescientist Posted November 7, 2011 Share Posted November 7, 2011 do you have links to the two individual scripts? basically what is being suggested is to create a new variable so that instead of your scripts operating globally, and thus interfering with each other, you namespace them within the context of an object so that you can call function c for one script and not stomp over function c in the other script. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.