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 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Alert box - can it be loaded each time the page loads?

    Hi

    I'm making a website for a local enterprise charity, the working copy of which can be found here: www.youthenterprise.co.uk/newhullready/coded

    no matter what I do, the navigation doesn't work in ie7 (I have consulted a programmer friend who doesn't get it either) so I'm having to launch the website with an alert box which pops up when the user is using ie7, warning them that their browser is not supported. It worked the first time I loaded the page using ie7 but doesn't do it after the first time you click ok. The problem is a lot of their traffic will come from schools and other instititions where multiple users will be using a computer so I need it to pop up every time someone tries to view it on ie7, even if they've clicked ok before.

    This is the javascript code I'm using:
    <!--[if IE 7.0]><script language="JavaScript">

    function WelcomeMSG ()
    {
    alert("Welcome to Hull Ready - the future is ours.
    Unfortunately this website can no longer support the browser Internet Explorer 7. All other browsers, including Internet Explorer 8 and above are supported.")
    }

    </script>

    <onLoad="WelcomeMSG()">
    <![endif]-->
    Please help, I'm new to javascript and jquery coding!

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,530 Times in 2,508 Posts
    Here you are (place in the <head>):-

    Code:
    <!--[if IE 7.0]>
    
    <script type = "text/javascript">
    
    alert ("Welcome to Hull Ready - the future is ours.\nUnfortunately this website can no longer support the browser Internet Explorer 7.\n All other browsers, including Internet Explorer 8 and above are supported.")
    
    </script>
    
    <![endif]-->
    Quizmaster: Which of these two boats is a palindrome - kayak or canoe?
    Contestant: Canoe.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you very much, that did the trick!

    Thanks again

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Sorry to chime in but I see no reason why the navigation shouldn’t work in IE 7. It doesn’t look overly complex to me, on a short glimpse with a modern browser.

    Also, on another note: You forgot to specify a general page background color. People can set their own browser background, text, and link colors in their browser settings so you shouldn’t rely on the default white being set everywhere. I have only noticed this because I have a light yellowish default browser background, and the graphics with the white background look out of place to me. Always set a background color on the html or body element.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,530 Times in 2,508 Posts
    Quote Originally Posted by VIPStephan View Post
    Sorry to chime in but I see no reason why the navigation shouldn’t work in IE 7. It doesn’t look overly complex to me, on a short glimpse with a modern browser.
    Agreed, but I don't have IE7 to test it, so must rely on what the OP claims.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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