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 the include funtion and javascript code

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
 
Hi

chriszd said:
My problem is that when i uploaded the js files for the menu, the javascript for the images stopped working for no apparent reason.
I would say your problem has nothing to do with PHP. Sounds like pure JavaScript problem : probably both script are registering their [tt]onload[/tt] event handler, but the second does not care about the first and overwrites the already registered handler. In that case better ask in forum216 . ( Or just google for "javascript multiple onload". )

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top