Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation Firefox ignores my javascript PROMPT dialog box..... HELP!

    Hey there guys, i've been having a problem lately and i can't seem to find any solution for that. I know you guys could help me, so here it goes:

    I have a javascript promt box (as you can see in the code below) it works perfectly fine with internet explorer however it's NOT working in firefox. I tried everything i can think of, but still its not working!

    Please check the code below and give me the solution for firefox. Thank You!



    <%@LANGUAGE="VBSCRIPT" CODEPAGE="28592"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
    <title>Choose Your Language</title>
    <script language="javascript" type="text/javascript">
    function checklang()
    {
    var lang = prompt('Choose A Language:'+'\n' + "(Ex: Armenian, Arabic, English, French, Greek, Russian)",'English');
    if (lang==null || lang=="")
    {lang=""; return;}

    if (lang=="Armenian" || lang=="Arabic" || lang=="English" || lang=="French" || lang=="Greek" || lang=="Russian")
    {location.href = "sermon-section.asp?lang="+lang};
    else
    location.reload();
    }
    </script>
    </head>

    <body>

    <a href="#" onclick="checklang()">Choose Your Language</a>

    </body>
    </html>

  • #2
    Regular Coder Amphiluke's Avatar
    Join Date
    Jul 2009
    Posts
    312
    Thanks
    3
    Thanked 89 Times in 89 Posts
    Code:
    if (lang=="Armenian" || lang=="Arabic" || lang=="English" || lang=="French" || lang=="Greek" || lang=="Russian")
    {location.href = "sermon-section.asp?lang="+lang};
    else
    location.reload();
    }
    Remove the semicolon...
    I am still learning English

  • Users who have thanked Amphiluke for this post:

    Davidasp (08-14-2009)

  • #3
    New Coder
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Thumbs up Thank You!

    I'm feeling sooooo stupid, how couldn't i see that

    Anyway thank you man !! Although it was a stupid thing i didn't notice, but you saved me
    i also gave you a reputation!
    Last edited by Davidasp; 08-14-2009 at 12:14 PM.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,912
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    This is a good example of the kind of bug which is likely to arise when braces and semi-colons are not properly positioned, or braces omitted. Far better thus:-


    Code:
    if (lang=="Armenian" || lang=="Arabic" || lang=="English" || lang=="French" || lang=="Greek" || lang=="Russian") {
    location.href = "sermon-section.asp?lang="+lang;
    }
    else {
    location.reload();
    }
    }


  •  

    Posting Permissions

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