/[drupal]/contributions/modules/jserrorlog/jserrorlog.js
ViewVC logotype

Contents of /contributions/modules/jserrorlog/jserrorlog.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu Dec 4 23:27:30 2008 UTC (11 months, 2 weeks ago) by xuriz
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/javascript
Initial commit of jserrorlog module. This module allows recording of clientside javascript errors via a POST back to Drupal. D5 only in this release.
1 // $Id$
2
3 /**
4 * capture javascript errors, then post
5 * to /jserrorlog/ and record them
6 */
7 var jsErrorLogger = {
8 URI: '/jserrorlog/',
9 onError: function(msg, file_loc, line_no) {
10 var data = {
11 message: msg,
12 file: file_loc,
13 line: line_no
14 } ;
15 try {
16 $.post( jsErrorLogger.URI, data ) ;
17 } catch (e) {
18 return false;
19 }
20 return true;
21 }
22 } ;
23 window.onerror = jsErrorLogger.onError ;

  ViewVC Help
Powered by ViewVC 1.1.2