GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes Stack overflow error in Javascript 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 error in Javascript" Watch "Stack overflow error in Javascript" New topic
Author

Stack overflow error in Javascript

Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Hi all,

I have written a simple javascript function to open a new window by using the method window.open() method.
When i run the application in Tnternet explorer I get an error "Stack Overflow at line:0" constantly.
Can anybody explain me why we get this error and a solution for this.
I even tried by turning off the "Disable script Debugging" in internent options.
But still there is no change.

Thanks in advance

Regards,
Janu
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Your magical Code is?

Eric
Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
hi,

Here is the code snippet.


I am calling this javascript code from Flex using the below code
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
LOL... You created a circular reference.

When you declare functions in global scope [as you did], you can call them via window.functionName().

so the following code



can be called via


or



along with countless other ways.

You just overwritten the window.open function so your code keeps calling itself. Rename your function to something else.

Eric
Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Oh thanks! Eric....I will change The function name.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

Never name anything submit either.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: Stack overflow error in Javascript