javascript eval statement JS Frames error

1

In this legacy application there is a javascript eval statement:

 eval(getElementText(VALUE[0]));

The command that it generates is a call to another function. However, in the screen that I'm dealing with that function never gets called in Firefox. Instead FireBug generates this information:

uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindowInternal.alert]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost/mywebserver/default.asp?bn=0.12345E-02&p=1&p2=1 :: ParseABCScreen :: line 718" data: no]

In IE9 believe it or not I get a little further but then I get a very generic unspecified error. Which shows me nothing.

Does anyone have any suggestions?

javascript
asked on Stack Overflow Jun 17, 2011 by webdad3

2 Answers

1

What I've managed to patch together from some searching is that this error occurs when you have an ajax call and in the error callback you attempt to check the status of the XMLHttpRequest. Apparently you're not supposed to do that.

Apparently it only happens in firefox because they're the only ones that follow the spec exactly.

answered on Stack Overflow Jun 17, 2011 by James Montagne
0

This type of error generally comes when trying to eval a javascript code with large amount of escaped data. System considers it as an attempt to inject some mallicious data.

One workaround is to put a try/catch statement on eval.

answered on Stack Overflow Mar 25, 2013 by user2206432 • edited Mar 25, 2013 by Baby Groot

User contributions licensed under CC BY-SA 3.0