File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stack Overflow Assistance

 
Chris Pare
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's usually a sign of an infinite loop or unending recursion. Inspect your code for such.
 
Chris Pare
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time you change the image source, the onload event fires.

Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic