PDA

View Full Version : Using code from .js directly in HTML file


riemant
05-17-2004, 09:13 PM
Hi,

I'm in a situation where I can't use .js files to work a multi-level navigation.

Being a beginner javascripter I thought I could copy and paste the javascript from the two .js files (menu_var and menu_com) into my HTML document and have the document work just fine. However I'm getting an error that I can't fix.

Please find attached a .zip file that contains the file Using_Ext_js.html which will show you what the menu navigation is supposed to look like when calling .js files.

The file test.html is the one that throws the error because the .js code is in the actual HTML page however I need it there.

If you have any advice it would be greatly appreciated.

Thanks,
Tanya

Roy Sinclair
05-17-2004, 09:49 PM
In your combined file you placed the scripts into the <head> while in the working uncombined one you've got them in the <body>, one of those scripts definitely requires being placed in the <body> so moving them to the body should fix them.

Turn ON the display of Javascript error messages in your browser, you've have been able to find the problem much easier by yourself if you'd known there was an error occuring which points to the problem.

riemant
05-18-2004, 01:32 AM
Thanks for your speedy assistance. This indeed solved the problem right away.

Much appreciated. That will make a world of difference in the project I'm working on.

Have a good one.

Take care,
Tanya