Internet Explorer Error Line Number
Contents |
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 an error has occurred in the script on this page windows 7 Stack Overflow the company Business Learn more about hiring developers or posting ads an error has occurred in the script on this page windows 10 with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Javascript Error Line Number
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
Object Doesn't Support This Property Or Method
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 javascript error object 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" + "
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
Firefox
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 Need to find actual location of line/char in Internet Explorer Script errors? http://stackoverflow.com/questions/10711072/retrieving-the-line-number-from-an-internet-explorer-error-object 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 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 http://stackoverflow.com/questions/1506593/need-to-find-actual-location-of-line-char-in-internet-explorer-script-errors 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 the scripts together to figure it out where the error is. If I can find the error in firefox using firebug then that's the easiest way. If it's an IE only problem what I do is enable script debugging in Internet Options, Go to Tools->Internet Options…->Advanced->Disable Script Debugging (Internet Explorer) Go to Tools->Internet Options…->Advanced->Dis
360 games PC games https://support.microsoft.com/en-us/kb/822521 Windows games Windows phone games Entertainment All Entertainment https://msdn.microsoft.com/en-us/library/gg589530(v=vs.85).aspx Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet error line Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All error line number Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
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. Internet Explorer 9 Samples and Tutorials Debugging and Troubleshooting Your Webpage How to use F12 Developer Tools to Debug your Webpages How to use F12 Developer Tools to Debug your Webpages Using the F12 Tools Console to View Errors and Status Using the F12 Tools Console to View Errors and Status Using the F12 Tools Console to View Errors and Status Introduction to F12 Developer Tools Getting Started with the F12 Developer Tools Using the F12 Tools Console to View Errors and Status F12 tools console error messages Using the F12 Developer Tools to Debug JavaScript Errors Using F12 Developer Tools to Debug HTML and CSS Using the Profiler Tool to analyze the performance of your code 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. Using the F12 Tools Console to View Errors and Status This content refers to an older version of F12 developer tools. Please visit our latest F12 tools documentation. The F12 tools console commands let you receive error messages from Windows Internet Explorer 9, as well as send your own messages back from your code without having to break the flow of your execution. You can use the F12 tools console view to immediately run script statements outside your program code. The console tab and view Sending messages from code to console Executing script and commands in the console Using cd() to execute commands across frames Executing multiple