Nov 20, 2002 #1 spewn Programmer Joined May 7, 2001 Messages 1,034 came across this on a web page source code... try{top.document.title = 'Misc General Merchandise';}catch(E){}; any ideas? - g
came across this on a web page source code... try{top.document.title = 'Misc General Merchandise';}catch(E){}; any ideas? - g
Nov 20, 2002 1 #2 Quinnie Programmer Joined Nov 18, 2002 Messages 31 Location GB 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 Upvote 0 Downvote
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
Nov 20, 2002 Thread starter #3 spewn Programmer Joined May 7, 2001 Messages 1,034 thanks. - g Upvote 0 Downvote
Nov 20, 2002 #4 palbano Programmer Joined Oct 9, 1998 Messages 4,341 Location US Quinnie, does Nutscrape support exception handling yet? -pete Upvote 0 Downvote
Nov 20, 2002 #5 Quinnie Programmer Joined Nov 18, 2002 Messages 31 Location GB 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] Upvote 0 Downvote
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]
Nov 20, 2002 #6 palbano Programmer Joined Oct 9, 1998 Messages 4,341 Location US Yep. Thanks much! -pete Upvote 0 Downvote