Internet Explorer Javascript Error Line Number
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Retrieving the line number from an Internet Explorer error object up vote 1 down vote favorite 1 Is there a way to retrieve the line number from an Internet Explorer 7/8 error object? I'm only aware of the .message, .description and .number properties. I've searched around a bit and found an MSDN article on .stack ( http://msdn.microsoft.com/en-us/library/hh699850(v=vs.94).aspx ), but even using their own example code doesn't return a line number: http://jsfiddle.net/LWevS/ javascript internet-explorer share|improve this question edited May 22 '12 at 22:36 asked May 22 '12 at 22:30 Elliot B. 6,06542866 Does this question help? –Ken White May 22 '12 at 22:33 Unfortunately it doesn't, I'm not setting up a debugger for dev purposes but rather once the code is in production. We'd like to be able to turn on JS error logging and store line number back instead of just a description of the error. –Elliot B. May 22 '12 at 22:35 You should perhaps edit your question to add that information, as it makes a difference in possible answers. –Ken White May 22 '12 at 22:37 1 Don't have an answer for you, sorry, but I had to comment 'cause your name is eerily close to mine. :-) –Elliot Bonneville May 22 '12 at 22:37 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted I dug around some more and found that it is possible to retrieve the line number in IE using window.onerror. It's not from the Error object itself, but it's a decent workaround: function BadFunction(){ This.badcode.willnot.work = 1000 } function ForceError(msg, url, lno) { alert("Error Occurred! Handled by Generic Error Handler" + "\n" + "Error: " + msg + "\n" + "URL: " + url + "\n" + "Line Number: " + lno); return true; } window.onerr
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it http://stackoverflow.com/questions/10711072/retrieving-the-line-number-from-an-internet-explorer-error-object only takes a minute: Sign up Need to find actual location of line/char in Internet Explorer Script errors? up vote 11 down vote favorite 3 I'm receiving a script error in IE: Line: 59 Char: 71 Error: Expected identifier, string, or number Code: 0 Line 59, character 71 don't seem to actually correspond to my code. It doesn't even say what http://stackoverflow.com/questions/1506593/need-to-find-actual-location-of-line-char-in-internet-explorer-script-errors file, but I've looked at my main javascript file, viewing the page source, etc. This has happened to me before and I've looked around until I finally find an error with the code -- usually a comma -- but I would really like to get some use out of these line/char numbers. I read once that it's a reference to the internal version of the page that IE reads from. Does anyone have information on how to find out what these numbers actually mean and see the line of code that's causing the problem? Appreciate any help! javascript debugging internet-explorer share|improve this question edited Oct 2 '09 at 2:58 Itay Moav -Malimovka 23.3k46134210 asked Oct 1 '09 at 21:24 croixhaug 8922912 add a comment| 4 Answers 4 active oldest votes up vote 16 down vote accepted I've found IE Line # / Char #'s to be useless or more hassle then it's worth. If you're including multiple javascript files and all it gives you is a line # and char # it's alot of work to concatenate all th
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of http://stackoverflow.com/questions/21614349/how-to-get-ie8-developer-tools-to-show-me-the-line-number-of-the-javascript-erro this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question https://msdn.microsoft.com/en-us/library/hh699850(v=vs.94).aspx x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up internet explorer How to get IE8 Developer Tools to show me the line number of the Javascript error? up vote 2 down vote favorite I've got an Angular app, lots of javascript. I load it up in IE8, and get an error that I'm not getting in other browsers. I open the Developer Tools, but it gives me only generic message. No stack trace, no internet explorer javascript line number. Here's a screen shot. Is there something I can do to get the error location? javascript internet-explorer-8 ie-developer-tools share|improve this question asked Feb 6 '14 at 21:23 Rob N 3,04812868 2 Try opening the site in a newer version of IE that does support line numbers, then set it to IE8 rendering mode? –greim Feb 6 '14 at 21:34 I went to IE9 and didn't get the line number but I got more information about the property/method that was being called so that I could search for it. 'hasOwnProperty' –Chris Bier Oct 14 '14 at 20:47 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote If you expand/scroll that part of Dev Tools you will see the line number and the source file where it happened. E.g. Moreover - clicking on that line will bring you directly to the source. share|improve this answer answered Feb 6 '14 at 21:34 Yuriy Galanter 27k73080 I've clicked all over that message. Nothing happens. You have IE8? –Rob N Feb 6 '14 at 21:48 Yes the above screenshot
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Samples Retired content We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. JavaScript Reference JavaScript Objects Error Object Error Object stack Property (Error) stack Property (Error) stack Property (Error) constructor Property (Error) prototype Property (Error) description Property (Error) message Property (Error) name Property (Error) number Property (Error) stack Property (Error) stackTraceLimit Property (Error) toString Method (Error) valueOf Method (Error) TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. stack Property (Error) (JavaScript) Gets or sets the error stack as a string that contains the stack trace frames. Syntax Copy object .stack RemarksThe stack property is set to undefined when the error is constructed, and gets the trace information when the error is raised. If an error is raised multiple times, the stack property is updated each time the error is raised.Stack frames are displayed in the following format: at FunctionName (