For AJAX application order form builds a mistake to refer a system
Tuesday, March 03, 2009 by rain
summary when process of a few application breaks down,They often offer an opportunity to submit the information about this mistake to the user.This information can help developer track and correct an error.If why apply the implementation in the program in your JavaScript/AJAX,the article will be revealed to you such function.
one, foreword
If can access the word of the computer of terminal user,So the JavaScript mistake of terminal user is debugged very easily.Since you cannot realize such operation,So you can be adopted leave such measure:The content that lets an user send you to amend this problem to need to you.
when like Mozilla browser such applied process breaks down,They can start a mistake to submit an order.Whether are these programs willing inquiry user to submit erroneous report.If the user is willing,When this program will ask they input the process that concerns them to break down as far as possible much information.This information,Along with this are wrong the analytic data that submits him order,So that develop personnel and project manager to read,refer email center together take an analysis.
this kind of function to developer it is extremely useful.Since this program moves at the client to carry a machine,go up,This is to be obtained exclusively about cannot be at developer on the development system of themselves the way that makes same wrong news afresh.They still can monitor so that this specific wrong frequency and seriousness decide to should correct what error above all.
If why support this kind of mistake to refer a function in JavaScript/AJAX program, article general is revealed to you.When a mistake happens in the code in you,This system will play the window that gives an user to be able to refer wrong message.
two, problem
If why installs an user mistake to submit an order in the JavaScript/AJAX application process in me?
three, solve
puts code in a program that pack,The email that should pack a program to allow an user to refer to contain detailed and erroneous information.
(one) capture mistake
following file is included in the download source code with corresponding article,You can use them to achieve the solution above:
This file includes Talkback.js- of · the complete source of this system
Test.html- of · uses Talkback.js to handle the script of give typical examples with a wrong discovery
The Test.html page here includes code of a few JavaScript,Cast among them give unusual.This page is function Fun_a() installation the Onload processor of Body part.This Fun_a() function calls Fun_b() again,Fun_b() calls Fun_c() again.Finally,Fun_c() accesses the nonexistent region in a nonexistent object,Spark a true JavaScript is unusual.
above all,Before the user can see this mistake you need to capture it.Such since,You can make the user has an opportunity to refer wrong message;But,You do not think those who let he or her to see any other content.Our target is the content that reduces this mistake to be exposed to the user as far as possible.
this is very easy implementation.Assume the main program is OK by is following function activations:
Function Fun()
{
/ / program here.
}Fun = Tb_wrap(Fun);
is opposite here please of Tb_wrap() call.Such since,Can put Fun() function to be able to capture any unusual and those who handle them pack implement in.And,Such since,What this user won't see any in Fun() happening is unusual.
(two) gather erroneous information
once you captured mistake,So you need to extract as far as possible much information.You send a developer more erroneous data hair,They discover more likely and correct this error.
What regrets is,The browser that moves according to the user is different,Wrong object has different property.Below most circumstance,You can depend on Name and Message attribute.Notice,An extremely useful inn trace is contained in Stack attribute,It is it can be used in the is based on Mozilla browser of the closest version only only.