Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Javascript Debugger
#1
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>
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 Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,098 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,637 01-26-2012, 03:13 PM
Last Post: iRun
  Close Tab With Javascript. Qua 3 1,226 07-02-2011, 07:25 AM
Last Post: djakariuz
  Keyboard shortcuts with JavaScript faviouz 12 2,615 05-07-2011, 01:21 AM
Last Post: Danny
  Javascript Help. Form Submission. JohnRonder 0 786 02-01-2011, 11:12 AM
Last Post: JohnRonder

Forum Jump:


Users browsing this thread: 1 Guest(s)