Alert box only popping up once

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kyofanatic1
    New Member
    • Sep 2010
    • 1

    #1

    Alert box only popping up once

    I have written a code so far that only pops up if you are using internet explorer. It asks you to make sure that your browser is up to date, but it pops up on every page on my site. I would like it to pop up only once.

    I have the code written so that it is all in java and in an external file.

    Code:
    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
     var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
     if  (ieversion>=7)
    var stay=confirm("The following site needs the most up-to-date browser. If you do not have that browser then you may encounter som prblems on the site. Please click 'ok' to make sure you have the most up-to-date browser. If you wish to view the site anyway please click 'cancel.'")
    if (stay)
    window.location="http://www.microsoft.com/windows/internet-explorer/default.aspx"}
    How should I go about fixing this?
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    On opening the popup initially perform the check for window.name

    Code:
    if(window.name=="")
    {
      your code...
      window.name="value";
    }
    else
    {
      return false;
    }
    Thanks and Regards
    Ramanan Kalirajan

    Comment

    Working...