Jump to content

Recommended Posts

Posted (edited)

Hi all,

I want to check if the user is using Internet Explorer 7 or above,

if it is version 7, he should have an Alert saying “You're using 7.x, please update your IE”

and if he has version 8 so NO alert should appear.

My code is bellow but I am getting alert for both versions.

Need help

 

 

<script type="text/javascript">
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>=8)
 alert("")
else if (ieversion>=7)
 alert("You're using 7.x, please update your IE")
}
</script>

Edited by fazlionline
Posted

What happens if you leave out the IE8 code (you don't need to tell the user anything if he is using IE8):-

<script type="text/javascript">
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)
 alert("You're using 7.x, please update your IE")
}
</script>

  • 3 weeks later...
Posted

I would rule against notifying users of IE7 to upgrade because that's a big chunk of the market. Besides, there may be a variety of reasons why users don't upgrade. One is that the employer will not allow it.

 

However, I would be in favor using it for IE6 users.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...