Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

show line numbers for console statements in IE 9 debugger

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!

like image 412
JasonBK Avatar asked Oct 21 '22 20:10

JasonBK


1 Answers

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.

like image 117
Paul Sweatte Avatar answered Oct 24 '22 11:10

Paul Sweatte