Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hey, any one ever see this?? - try{}... 1

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034

came across this on a web page source code...

try{top.document.title = 'Misc General Merchandise';}catch(E){};

any ideas?

- g
 
It is for error catching seen frequently in Java (not that common in Javascript).

It says try {to set the document title to 'Misc General Merchandise'} and if an error occurs catch it (store error information in E) {and do nothing}

i.e.

try {
normal code that could go wrong
} catch (errorVariable) {
code to be run if there is an error
}

Kev

[afro2]
 
Quinnie, does Nutscrape support exception handling yet?

-pete
 
palbano,

Depends what you mean. Can't do this level of handling up until NS6 but can over-ride onerror event, which can show if you like.

try ... catch was added in JS1.4 for NS6
try ... catch with multiple catches was added in JS1.5 for NS6

Hope this is what you ment.

Kev
[Afro2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top