•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 361,618 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,151 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 290 | Replies: 1
![]() |
I am new to javascript and have made a simple form accepting details of login on a web page. I fail to understand how the following code handles the error when written between script tags:
Could someone help me!!!
function errorhandler(errormessage,url,line)
{
alert("Error :"+errormessage);
alert("url :" +url);
alert("line :"+line);
return true;
}
onerror=errorhandler;•
•
Join Date: Sep 2007
Posts: 61
Reputation:
Rep Power: 1
Solved Threads: 6
There are two ways to handle error
I discuss this, and many other JS issues, in my quickreference guide
JavaScript Quick Reference
Hope this helps.
- onerror - which just allows you to carry on gracefully when there is an error but takes little corrective action
- The try..catch code block that allows you to trap the error and deal with its consequences
I discuss this, and many other JS issues, in my quickreference guide
JavaScript Quick Reference
Hope this helps.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
Similar Threads
- how to make error handling (VB.NET)
- Error handling (PHP)
- Error Handling in CFSCRIPT (ColdFusion)
- Handling errors in php! ??? (PHP)
- Compilation Error Handles cmdLogin.ServerClick (ASP.NET)
- Another mysql_num_rows(): error (PHP)
- Keyboard Error Handling (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Is there a sleep/wait javascript function for firefox?
- Next Thread: please help in java script


Linear Mode