Git Product home page Git Product logo

jquery-error-handler-plugin's Introduction

jQuery error capturing plugin

This jQuery plugin send an email when a javascript error is triggered. Specially useful in big web application where you want to know if users hit javascript errors.

A php mail example is given with this plugin, but it could also be easily logged in a database

Integration

Load the plugin just after the jQuery library

  $(document).jsErrorHandler();

Options

You can define some options.

By default the plugin automatically fetch the domain and add it to the email subject, but you can overwrite it. You can also define a from, I would highly recommend that you change the from setting in the plugin file (jquery.onerror.js) if your going to use this plugin on multiple websites.

 $(document).jsErrorHandler({
    from: "[email protected]",
	website: document.domain
 });

The Email

The email received will look like this:

A javascript error has been detected on www.position-absolute.com

Message: variable is not defined

Url: http://www.position-absolute.com/creation/onerror/

Line: 21

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0

Limitation

The plugin works on Firefox 3.6+, Chrome Latest, IE7+

It does not work on Safari and Opera, but it will not break your application.

jquery-error-handler-plugin's People

Contributors

posabsolute avatar yahelc avatar

Watchers

lincong avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.