I am testing my web application locally with IE Tester to test how it works with different version of Internet Explorer. It runs fine on IE8 and IE9, but in IE7 it returns a Script Error:
Line: 85
Char: 9
Error: Expected identifier, string or number
Code: 0
URL: http://localhost:9662/test.aspx
I’ve read on various places the cause of this problem, where there is a comma left at the ending a parametric function.
My problem is not understanding the cause of the problem, but locating the line that causes the problem. My test.aspx has less lines than 85. I assume that IE7 flattens the scripts in my page and returns the line of the error after rendering the page with all the scripts.
How can I locate the exact line using IE tester / Debugger or any other tools in that respect.
Thanks.
IE7 is not flattening the scripts; ASP is a dynamic language, and your page (test.aspx) contains imperative expressions that evaluates to a declarative form (HTML) – this declarative page will contain any logic folded into the dynamic page, and, most of the time, will result in longer contents.
IE Tester has no debug stepper, but you should be able to simply view the (evaluated) page source and track down the exact line / column in the JavaScript code.
Run the page in an IE instance of your choice (probably IE7) in order to reproduce the error message:
Than click the View Source button under Dev Tools and track the location stated in the message (line / char):