• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

HTML/CSS/javascript Code that recognices the browser version

Some code works for older browser versions, some doesn't. Is there a way to detect the version of the users browser and post a message like "To view this site in its full functionality, you need to download a newer version of your browser". Or even provide a link to that download if possible, depending on the different browser.
The proyect manager is demanding for full functionality in all versions but seams not to understand it's not always possible, I'm trying to provide an alternative solution.
0
victorcosta85
Asked:
victorcosta85
1 Solution
 
ploftinCommented:
0
 
victorcosta85Author Commented:
Thanks for the links, but I kind of need a simplified solution, if I intended to read and learn about it, i wouldn't be using experts exchange for quick solutions.

So its a javascript issue, I'll post this message again in the proper zone.
Thanks again guys.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
cyberpunk71Commented:
You say its a javascript problem. Is it browser specific? or Javascript version specific? If its browser specific, let me know what browser don't work and do work. If its a Javascript version specific then let me know what it is? I'll post some code when you give this.
0
 
s8webCommented:
victorcosta,

Are you using a server language like php, coldfusion, or asp?
0
 
s8webCommented:
This will work for IE versions less than 7. It would be more reliable to do this server side though. this should go in the head.

It will give the user an option to go to a link you specify, or otherwise say whatever you want to say.
<script type="text/javascript">
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
var ieversion=new Number(RegExp.$1) 
if (ieversion<=7)
document.write("Your browser is pretty old, some things just aren't going to work right. If you are interested in updating it, <a href='http://www.google.com'>click here</a>.")
}
</script>

Open in new window

0
 
s8webCommented:
Oops, this shows ie7 users the message, my bad, should be:


<script type="text/javascript">
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
var ieversion=new Number(RegExp.$1) 
if (ieversion<=6)
document.write("Your browser is pretty old, some things just aren't going to work right. If you are interested in updating it, <a href='http://www.google.com'>click here</a>.")
}
</script>

Open in new window

0
 
victorcosta85Author Commented:
s8web, your code works perfect for IE. Thats the one that bothers me the most... Is there a similar code for safari?
The other browsers (chrome, mozilla,opera,etc usually are used by people that know what an update is).
Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now