Question : Run JS only once (check IE version)

I saw an article (click here) which discussed how to check the version of IE a user is using.

On my website I want to basically (1) check their IE version (IF they are using IE), then (2) if it's < version 7 alert them with a message. This block of code should go on every page. (I put it in <body onload="check_version();"> ).

But I only want the alert to show up 1 time ONLY! So if they visit the website again the message will only show up once (if any) and won't reappear for a while (ie until the browser is restarted etc) I don't want the alert to pop up on every page of the website, though they may navigate the entire site.

How can I do this exactly? I don't know js so detailed code samples are appreciated. Thanks

Answer : Run JS only once (check IE version)

just check the link provided, no need to be familiar with js
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function alertOrNot() {
  if( getCookie("ieversion") == "") {
       var iever = getInternetExplorerVersion();
       setCookie("ieversion", iever)
       if(iever<7) {
           alert("your ie version < 7");
       }
  }
}
</script>
<body onload="alertOrNot();">
Random Solutions  
 
programming4us programming4us