Hii ..i am a lamp professional!! i use javascript for validation purposes! but sometimes javascript stops working bcos of errors!!and i find it difficult to find those errors! is there any log for javascript errors??
seeing javascript errors
Collapse
X
-
Tags: None
-
Pradeepjain,
Ya, there are two ways of finding errors in your codes. The first way is writing your js code inside a try catch block and the other is to test the codes with the alerts one line after the other. These are the possible two ways through which u can find or debug an error in the js.
Try Catch Block
Code:try{ // your JS Code... // your JS Code... } catch(e) { alert(e.message); }
Alerts
Thanks and RegardsCode:js line no 1 alert("1"); js line no 2 alert("2"); js line no 3 alert("3"); js line no 4 alert("4");
Ramanan Kalirajan -
showing error in separate window for debugging
hi
you can using this code for showing your error in separate window and the end of debuging your scripts you can erase this code from the other code
on the input of script tag
and so if your browser is firefox you can see your errorCode:<script type="text/javascript"> onerror=showErr; function showErr(errMsg,location,lineNum) { ErrWin=window.open('','new window',"width=100, height=100"); ErrWin.document.write('message of error '+errMsg+'<br />place of error '+location+'number of line that have error'+lineNum); ErrWin.document.close(); } </script>
by clicking menu tools->javascript consol
be successComment
-
.Net method of logging JavaScript Errors
I have just released code to help log JavaScript errors by sending error information to the server. If you want to use ASP.Net, you can take a look at the control here -
Comment
Comment