Try/catch is part of the ECMA-Script 262 standard, which the Mozilla
engine fully supports. They even need to, since the presentation layer
of for ex. FireFox is made of 50% Javascript code.

Micha Schopman
Project Manager

Modern Media, Databankweg 12 M, 3821 AL  Amersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380

------------------------------------------------------------------------
------------------------------------------------------------------------
-----
Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren
de interactie met uw doelgroep. 
Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer
informatie zie www.modernmedia.nl 
------------------------------------------------------------------------
------------------------------------------------------------------------
-----
-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
Sent: woensdag 11 mei 2005 15:42
To: CF-Talk
Subject: RE: Dynamic Javascript Question

last I knew javascript try-catch wasn't cross-browser... I think IE
allows it but Mozilla browsers tell you that you can't use the keyword
"try" when you attempt it. Or at least that was my experience
previously.

> Be careful with the private variables outside of your
> function scope.
> You might think you made them private, but in fact they
> are public
> because you have defined them outside the function. You
> have defined
> them as global variables now.

> I have enclosed the parts with try catch parts, which
> might help you
> finding out where it goes wrong.

> <script type="text/javascript">
>       function clientRecPop(i) {
>               if(parseInt(i) <= 0){
>                       alert('i contained is not a valid number');
>                       return;
>               }

>               try{
>               var clid =
> document.forms['clientSearch'].elements['client_id'+i];
>               var compName =
> document.forms['clientSearch'].elements['client_id'+i];
>               }catch(e){
>               alert('something went wrong in the first part, fields
> not existing etc.');
>               }

>               if(window.opener){
>                               try{
> window.opener.document.forms['NewJob'].elements['clientID'
> ].value =
> clid;

> window.opener.document.forms['NewJob'].elements['coName'].
> value =
> compName;
> }catch(e){
>               alert('something went wrong in the second part, fields
> not existing in opener window etc.');
>               }
>               }



>               //window.close()
> }

> </script>


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:206495
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to