11-06-2009, 09:44 PM
Credits and Source: http://jsmadeeasy.com/
Name: Javascript Debugger
Description: Having trouble adding a JavaScript to your site? Just can't get things working? Add this short script to your site, and it will report to you JavaScript errors as they happen in a box on the screen. The idea is that you will see what the error is, and hopefully give you some ideas on how to fix it. The error will be displayed in the box.
Snippet:
Insert into <HEAD>
Insert into <BODY>
That's it
Thankyou for reading. Be happy always
Name: Javascript Debugger
Description: Having trouble adding a JavaScript to your site? Just can't get things working? Add this short script to your site, and it will report to you JavaScript errors as they happen in a box on the screen. The idea is that you will see what the error is, and hopefully give you some ideas on how to fix it. The error will be displayed in the box.
Snippet:
Insert into <HEAD>
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
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;
// End -->
</script>
</HEAD>
Insert into <BODY>
Code:
<form name=errform>
<textarea name=error rows=5 cols=70></textarea>
</form>
<!--For this example, clicking this button will cause a JavaScript error, that<br>the function is not defined. The error will be displayed in the box below.-->
<form name=err>
<input type=button value="Cause JS Error" onClick="brokenScript()">
</form>
That's it
Thankyou for reading. Be happy always