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

function expected error 1

Status
Not open for further replies.

glenmac

Technical User
Jul 3, 2002
947
CA
I'm getting a runtime error "line 0 function exspected" error on scrolling this page; .
I use the onscroll event to stop the stars function and think this is where my error is coming from. Can anyone enlighten me as to how to fix this? All help will be much appreciated!

Glen
 
The issue you ask about is because you have a timer running the "fly" function, but onscroll, you change "fly" from being a function to being a boolean without stopping the timer.

One immediate workaround is to change:

Code:
onscroll="fly=false;"

to

Code:
onscroll="fly=function(){};"

although IMHO, you're better off cancelling the timer.

Incidentally, I'd try validating your markup.

I'd also get rid of that crazy large MP3 that plays. What a complete waste of bandwidth. The "starfield" effect is pretty old-hat, too, and the code behind it looks like it's written for old v4 browsers. I'd update that too (if you must have annoying effects like that on a web page).

Also note that your border doesn't show up in Firefox (you need to specify 'px' units).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top