Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Script debugger


< html >
< head >
< script >
function reportError(msg,url,line) {
var str = "Err: " + msg + " on line: "
+ line + "\nURL: " + url   + "\nWeb: "
+ navigator.appName + " " + navigator.appName
+ " " + navigator.appVersion;
document.errform.error.value = str;
return true ;
}
window.onerror = reportError;
</ script >

</ head >

< body >
< form name = err >
< input type = button value = "Cause JS Error" onClick = "brokenScript()" >
</ form >< p >
< form name = errform >
< textarea name = error rows = 5 cols = 70 ></ textarea >
</ form >

</ BODY >
</ html >

//Thanks to David Pye for his JavaScript Vault contribution.