1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can you help me?

Discussion in 'HTML & Website Design' started by fumi, Mar 23, 2005.

  1. #1
    I am doing my homework but I have no idea how to jamp another page using switch statement in Javascript. :confused:

    switch (strUserName){
    case "KFoster":
    if (strPassword="MST3K") {
    location.href = strDepartment & ".htm";
    }
    else
    {
    window.alert("Please try again");
    }
    break;
    }

    userName and password are given.
    When I run this program, it says "The page cannot be displayed".
    I assume that something wrong with location.href......

    If you have any idea to make this program run, help me please!
     
    fumi, Mar 23, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if (strPassword=="MST3K") {
    location.href = strDepartment + ".htm";
     
    J.D., Mar 23, 2005 IP
  3. fumi

    fumi Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey, J.D.
    Thank you!! It worked well soon after I fixed it as the way you showed me.
    Actually it was pretty basic thing.......
    Thanks a lot!!
    have a great weekend.
    fumi
     
    fumi, Mar 25, 2005 IP