aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Stack Overflow Assistance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Stack Overflow Assistance" Watch "Stack Overflow Assistance" New topic
Author

Stack Overflow Assistance

Chris Pare
Greenhorn

Joined: Dec 01, 2010
Posts: 5

Hoping someone can assist with this HTML Page, it's giving me a "Stack Overflow Error", it's the first time I have bumped into one, I think it's the onload javascript, but I am not sure why it's blowing up. I tried to step through it in the IE9 develper tools, but I am not sure what going on...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

That's usually a sign of an infinite loop or unending recursion. Inspect your code for such.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chris Pare
Greenhorn

Joined: Dec 01, 2010
Posts: 5

Bear Bibeault wrote:That's usually a sign of an infinite loop or unending recursion. Inspect your code for such.


I was able to get as far as seeing that the loop goes away if I comment out the comments of the WhatImageFirst function, and starts up again as soon as I add the IF logic, and the img.src = "ilock30.png";

Is not correct?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Every time you change the image source, the onload event fires.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ALso you should not be referencing elements directly by their id. You are using something that is not efficient and is not supported in every browser. Pass a string and use getElementById OR pass in the current scope of this when appropriate.

Eric
 
Consider Paul's rocket mass heater.
 
subject: Stack Overflow Assistance