?
Solved

Is it possible to use javascript to track if got any javascript error?

Posted on 2011-10-10
4
Medium Priority
?
132 Views
Last Modified: 2012-08-14
Is there a way to send this information to the server side? if got any runtime error?
0
Comment
Question by:SidGBF
  • 2
4 Comments
 
LVL 12

Expert Comment

by:zappafan2k2
ID: 36942955
I suppose you could use a try ... catch statement and make an ajax call upon error.

try {
document.write('Test');

} catch (err) {
// make an ajax call to a script with the error message here.
}

Open in new window


More information on the try ... catch statement:
http://www.w3schools.com/js/js_try_catch.asp

Please note that I've never done this, but it should be possible.
0
 
LVL 83

Expert Comment

by:leakim971
ID: 36946454
A bit off-topic : http://docs.jquery.com/Qunit
0
 

Author Comment

by:SidGBF
ID: 36969992
Actually I meant something global.

Usually in IE we have some errors in third party scripts. I wanted to be able to know if something happened to the document while loading...
0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36971615
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question