PDA

View Full Version : i am trying to use two different scripts but they are not working simultaneously



noman
09-24-2006, 07:21 PM
1) Script Title:
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
2)Script URL:
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

1) Script Title (2):
/***********************************************
* Cool DHTML tooltip script II- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
2)Script URL:
http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm
3) Describe problem:

i m trying to use both scripts togather on my web site, but if i use both then only the first one, menu is working and no tool tips are appearing, and if i remove only the javascrpt code from the head for swtch menu, then tool tips start appearing
pl help me, i have invested alot of time
thank you in advance
bye

quocthuyet
09-25-2006, 04:20 AM
I have the same problem . I use two scripts in my website but only one of them is working.

jscheuer1
09-25-2006, 07:21 AM
Here is what I often recommend folks look into:


See this tutorial (http://www.javascriptkit.com/javatutors/multiplejava.shtml) for one possible solution.

Aside from the tutorial above, which usually is the solution when the problem is two different scripts, you may need to consult:

http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=0&TOshow=allshow#refcon

Which explains how two scripts on the same page may not use the same set of variable names, id names, function names, etc. This is especially important if the problem is two copies of the same script on a page but, can come into play with two different scripts when the first step (tutorial) won't fix it.

One other approach that works in both situations, if adaptable to one (or more) of the scripts, is to put one script in a borderless iframe. It will look like it is on the same page but, since it really is on a separate page, conflicts are no longer an issue.