• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stack Overflow Assistance

 
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every time you change the image source, the onload event fires.

Eric
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic