How To Debug Javascript Error In Ie7
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 Stack Overflow the company Business Learn more how to debug javascript in ie 11 about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Ie7 Developer Toolbar
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping web development helper each other. Join them; it only takes a minute: Sign up debugging javascript error in ie7? up vote 4 down vote favorite All I get is this: An error has occurred in the script on this page line: 31 debug javascript chrome char: 5 error: expected identifier, string or number code: 0 url: http://example.com It's difficult to find that line since I have several external and internal scripts. How can I debug this? (By the way, the scripts have no errors in chrome or firefox or ie8+) javascript internet-explorer debugging share|improve this question asked Sep 29 '10 at 16:02 Matthew 5,6932070112 3 Probably a dangling comma. It's always a dangling comma. –Stephen Sep 29 '10 at 16:04
Ie11 Developer Tools
Add line 31 into your answer from the page itself. Doesn't sound as though its coming from an external file as IE normally tells you it's a problem with an external file. –GenericTypeTea Sep 29 '10 at 16:05 add a comment| 6 Answers 6 active oldest votes up vote 1 down vote accepted Try debugging it with IE8's Developer Tools (press F12). You should be able to step through the JS code (from all your scripts) to find out what is wrong with line 31 / char 5. share|improve this answer answered Sep 29 '10 at 16:06 Mike Atlas 6,36132752 add a comment| up vote 2 down vote You can download IETester which lets you use various versions of IE (6-8) and has built-in developer tools. They're not spectacular, but they're better than the nothing that old versions of IE provide. share|improve this answer edited Sep 30 '10 at 0:57 answered Sep 29 '10 at 16:09 Adam J.R. Erickson 91011021 1 His question is "How do I debug this?" My answer is a suggestion for a tool to use to debug it. I think it should be an answer, not a comment. –Adam J.R. Erickson Sep 29 '10 at 16:30 add a comment| up vote 1 down vote If it says it's on the page, then it means the page itself. If it was in an exte
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 firebug lite 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 debugging javascript error in ie7? up vote 4 down vote favorite All I get is this: An error has occurred in the script on this page line: 31 char: 5 error: expected identifier, string or number code: http://stackoverflow.com/questions/3823465/debugging-javascript-error-in-ie7 0 url: http://example.com It's difficult to find that line since I have several external and internal scripts. How can I debug this? (By the way, the scripts have no errors in chrome or firefox or ie8+) javascript internet-explorer debugging share|improve this question asked Sep 29 '10 at 16:02 Matthew 5,6932070112 3 Probably a dangling comma. It's always a dangling comma. –Stephen Sep 29 '10 at 16:04 Add line 31 into your answer from the page itself. Doesn't sound as http://stackoverflow.com/questions/3823465/debugging-javascript-error-in-ie7 though its coming from an external file as IE normally tells you it's a problem with an external file. –GenericTypeTea Sep 29 '10 at 16:05 add a comment| 6 Answers 6 active oldest votes up vote 1 down vote accepted Try debugging it with IE8's Developer Tools (press F12). You should be able to step through the JS code (from all your scripts) to find out what is wrong with line 31 / char 5. share|improve this answer answered Sep 29 '10 at 16:06 Mike Atlas 6,36132752 add a comment| up vote 2 down vote You can download IETester which lets you use various versions of IE (6-8) and has built-in developer tools. They're not spectacular, but they're better than the nothing that old versions of IE provide. share|improve this answer edited Sep 30 '10 at 0:57 answered Sep 29 '10 at 16:09 Adam J.R. Erickson 91011021 1 His question is "How do I debug this?" My answer is a suggestion for a tool to use to debug it. I think it should be an answer, not a comment. –Adam J.R. Erickson Sep 29 '10 at 16:30 add a comment| up vote 1 down vote If it says it's on the page, then it means the page itself. If it was in an external file, it would indicate that the error occured in something.js. Open up your webpage, right click on the page and select "View Source". Go to line 31 an
and alert(); becomes your only friend, or so I thought. I've recently done quite a lot of javascript DOM work for a site including some AJAX stuff and whilst it was a http://bealers.com/2007/01/12/debugging-javascript-in-ie7/ pleasure to develop in Firefox using Firebug, I'm now getting "it doesn't work" errors with IE 7 and I need something more. A bit of Googling comes up with a couple of useful links here and here which looked like good advice, so I followed it thus: Fire up IE7 Tools -> Internet Options -> Advanced: Disable script debugging (Internet Explorer) is ticked, untick it. Restart IE. Right click debug javascript on the menu bar area and enable the Menu bar (mine was hidden anyway) then go to View -> Script Debugger -> Open. If you don't get a pop-up asking you to choose a debugger (I didn't) then you need to install the Microsoft script editor which comes with MS Office (weirdly). Just to check, Windows-key and F should bring up a search, look for MSE7.exe if you don't have how to debug it (I didn't) put your office CD in and run setup. Under office tools -> HTML Tools -> Web scripting -> Web debugging, right click and select "Run from my computer". Restart IE. View -> Script Debugger -> Open should now give you your pop-up, yay! Now you can open your page in IE and make it break, when it does you shoudl get a "Do you want to debug" message. Yes we do so a press of 'Yes' gives us the same pop-up, selecting the Script editor allows us to do things other than just adding alerts() everywhere. For example we can pause the interpreter, step over each line, add watches and other normal debug things. In conjunction with the View DOM option in the IE 7 developers toolbar IE almost doesn't suck so much now. Using the debugger doesn't automatically fix your code, though. Refererences: http://erik.eae.net/archives/2005/07/04/21.49.50/ http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html p.s. I only tried the other debugger option once, it didn't look all that so I stopped using it. ABOUT THE AUTHOR bealers HI, I'm Bealers and this is my blog where I share the ups and downs of my journey from burnt-out mess to productive and positive. If you're new to the site then you might want