user2483724
user2483724

Reputation: 2119

How do I debug in IE if there are no errors being thrown?

I am finding it impossible to debug for IE. (Multiple versions, I'm using version 11, someone else has used 7, requirements are to support 9+) This is because there seem to be no errors thrown at all in the console. Some parts of the page simply do not load. When there was a similar error in firefox an error was thrown that gave me some clue as to what was wrong. Maybe I'm not using the developer tools correctly, but under console everything seems fine, it's just that the page is broken.

Upvotes: 0

Views: 43

Answers (2)

Jeremy J Starcher
Jeremy J Starcher

Reputation: 23863

Couple of things that you can do to help your life:

Try a console.log wrapper

Most versions of IE crash and burn if there is a console.log statement and the console isn't open. Things simply fail silently. I'd recommend a wrapper, something like this one: http://www.paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/

Use window.onerror

window.onerror is a bit hacky, but it can sometimes really help. This might point you in a useful direction: http://danlimerick.wordpress.com/2014/01/18/how-to-catch-javascript-errors-with-window-onerror-even-on-chrome-and-firefox/

Add an alert at the beginning of each file to make sure it is loaded and run.

Using an alert can help let you know if there is a syntax error loading a file.

Upvotes: 2

SeDav
SeDav

Reputation: 781

As I am a Linux user I can not directly test it. But in most Browsers there is a certain debug Statement, that you can insert in the code. And the second posibility should be opening the Developer Tools from the Browsers menu.

See Debugger Statement at MSDN

Upvotes: 0

Related Questions