Click to See Complete Forum and Search --> : Conflicting Javascripts and Possible OnLoad Solution


shakyfry
April 16th, 2008, 08:16 PM
I have multiple javascripts on my page and I have been using them for quite sometime without any problems.

I attempted to add a new javascript for a new navigation menu and both scripts now do not work together when they co-inside in the same head. I researched and the best I could come up with is renaming variables or functions or using the OnLoad function. I have tried this to the best of my knowlegde without any success.

I am not very familiar with javascript but I have narrowed it down to these two scripts. When I remove prototype.js and keep global.js in the head, the top menu works as it should but the modalbox drop down does not, and prototype.js is needed for modalbox dropdowns to work.

If I remove global.js and keep prototype.js in the head, the menu does not work as it should but the modalbox drop downs do work. If I have both scripts (global.js and prototype.js) in the head only the modalbox drop down works. (prototype.js)

I have tried renaming variables, onload, ect with no luck, so here I am.

The entire site is template based, and it uses smarty libs just to let you know.

Here is the link to the files in a zip file. Please help.

http://www.moviedash.com/fix.zip

PeejAvery
April 17th, 2008, 08:11 AM
Yes, it could be duplicate variable names, but it could also be a duplicate function name as well. Your best way to track this down is to use Firefox's Error Console. If there is any error, you will find it there. If there isn't...post back.

shakyfry
April 17th, 2008, 02:19 PM
There is no error in Firefox when it loads with both prototype.js and global .js in the head.

prototype.js works (pop down modalbox)
global.js does not (navigation menu)

when loaded together.

shakyfry
April 17th, 2008, 02:21 PM
I give up, I have tried several different forums, research hundreds of pages (no kidding) and have tried countless re-tries with the script.

It doesn't seem like anyone has a straight answer or maybe knows.

Thanks

shakyfry
April 18th, 2008, 02:37 AM
There are no errors showing in the Firefox console.

PeejAvery
April 18th, 2008, 09:22 AM
Okay...now have you checked for duplicate function names? After that...variable names? Checked all of what happens at onload?

We just don't have the time to sort through dozens of JS files, many with obfuscated code, to find that. This could take hours.

PeejAvery
May 7th, 2008, 03:42 PM
[ merged ]