User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Mar 2008
Location: India
Posts: 5
Reputation: dolphin.rise is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dolphin.rise's Avatar
dolphin.rise dolphin.rise is offline Offline
Newbie Poster

Error handling

  #1  
Mar 21st, 2008
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:
function errorhandler(errormessage,url,line)
{
alert("Error :"+errormessage);
alert("url :" +url);
alert("line :"+line);
return true;
}
onerror=errorhandler;
Could someone help me!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 61
Reputation: ExplainThat is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
ExplainThat ExplainThat is offline Offline
Junior Poster in Training

Re: Error handling

  #2  
Mar 21st, 2008
There are two ways to handle error
  • 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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC