Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using two java scripts

Status
Not open for further replies.

chriszd

Technical User
Apr 21, 2008
42
MT
Hi Guys,

I am creating a website where i am using a page called menu.php in which i have only the menu. The code for the menu is done with javascript as to have the slide in effects for the rest of the sub menu items for each category.

On the other pages i am using the include ('menu.php'); function as to show the menu. In some of these pages i do also have a diff java script running used to show images.


My problem is that when i uploaded the js files for the menu, the javascript for the images stopped working for no apparent reason.

When i removed the menu script it worked again.

How can i use too diff java scripts with this kind of setup?
or what am i doing wrong?

Thanks

 
I imagine each of your scripts is overriding the 'onload' event instead of listening to it.

You could work around this by having one 'onload' function that called the functions for both of your scripts.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi

Actually when I suggested you to re-post here because it sounds like JavaScript related problem, I hoped you will rephrase the question giving us more JavaScript related details...

That way we can offer a handier solution than just generic suggestion.

If that page is publicly accessible, posting its URL would be enough.

Feherke.
 
how do i do that

Which part do you not know how to do? To define a function? To find the existing onload events?

The latter can be done by searching the source for 'onload'. The former is a standard JS function - which you must have examples of already in your existing code.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top