Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I rarely use it, but here's how I do it if and when:
    Code:
    <script type="text/javascript" language="javascript">
      var myArray;
      var keepOnRollin = true;
      try {
        myArray = new Array(3);
        myArray[0] = 'item1';
        myArray[1] = 'item2';
        myArray[2] = 'item3';
      } catch (ex) {
        keepOnRollin = window.confirm('Error populating myArray\n' + ex.value);
      } finally {
        if (keepOnRollin) {
          myFunction(myArray);
        }
      }
    </script>
    Anyone else have anything to add to this?

    EDIT: replaced "continue" with "keepOnRollin". Good catch, filburt

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    continue is a reserved word (immediately start next iteration of a loop).
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:16 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com