Question

I hope this is something simple.. I am using the F12 Development tool debugger in IE 9. Is there a way I can display the line numbers and file source for each console statement, the same way that Firebug displays this info? I may have overlooked something basic, but I haven't yet found a way to do this..Thanks!

Was it helpful?

Solution

The only way to get line numbers is to define a window.onerror method:

window.onerror = function (message, url, lineNo)
  {
  console.log('Error: ' + message + '\n' + 'Line Number: ' + lineNo);

  return true;
  }

console.log(window);
console.log(1=2);

But even then, IE breaks on the error, so it's rather useless.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top