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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknown script error

Status
Not open for further replies.

Streetdaddy

Programmer
Jun 10, 1999
161
AU
I am having some weird problems with a script at
It gives a javascript error on the first time the page loads, but on subsequent page refreshes the script error is gone. The page uses the macromedia js for rollovers, and then other scripts for the dynamic menus which are made up of js arrays and uses cookies to remember which submenus were expanded by the user previously.

I suspect the following possibilities:

1. The cookie doesn't exist yet so it doesn't like trying to set it to a variable.

2. The Macromedia js somehow interferes with the menu js

3. I'm stupid.

If anyone can shed some light on this problem it'd be much appreciated...

Cheers. Miles

Those Micros~1 guys sure know what they doing!
 
Your error points to a call of the function named start on line 269 & it looks like you put this function call at the end of the html so that it's called after the page is loaded - the function refers to an object that doesn't yet exist. On future page loads the object already exists in cache. Putting functions inline in this way is always open to error because the call will be made while images and other page elkements are still being loaded. Can you go <body onLoad=&quot;start();&quot;> instead? --------------------------------

jb
 
I'll give it a go! Should've tried it already... Miles

Those Micros~1 guys sure know what they doing!
 
ok, ive now put the call to the function that creates the arrays in the onLoad in the body tag. All of the scripts are located in the head of the html, so there are no inline functions on the page. Now I get a javascript error 'Object expected' pointing to the line of html that the body tag is on??? Argh Im a bit bewildered! Miles

Those Micros~1 guys sure know what they doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top