Monday, October 31, 2011

Best Javascript Debugger

While in production the best javascript debugger is the line of code below.
window.onerror = function(error,file,line){alert(error+'\n'+file+'\n'+line);}
Add it to the beginning of your script and the error will be alerted. The alert will have the error, file name and what line the error occurred on. Make sure to remove it once out of production mode.

No comments:

Post a Comment