SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Alameda, CA
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Var error message

    I am getting the following error message:

    'ver' is undefined

    How can I correct this?

    Here is the script I have:

    <SCRIPT language="JavaScript">
    <!--
    bName = navigator.appName;
    bVer = parseInt(navigator.appVersion);
    if (bName == "Netscape" && bVer == 4) ver = "n4";
    if (ver == "n4") {
    window.location="form_net.asp";
    }
    else
    {
    window.location="form.asp";
    }
    //-->
    </SCRIPT>

    Thank you in advance
    Michael J. Swartz
    Founder and Senior Web Architect
    Bay Area Web Design

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2002
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A variable needs to exist before you can 'test' it.
    So:

    <SCRIPT language="JavaScript">
    <!--
    var ver=null;
    bName = navigator.appName;
    ...

    should work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •