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.
How should I go about fixing this?
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"}
Comment