Solved

HTML/CSS/javascript Code that recognices the browser version

Posted on 2010-08-18
9
282 Views
Last Modified: 2012-06-27
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
Comment
Question by:victorcosta85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 5

Expert Comment

by:ploftin
ID: 33465982
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33465993
0
 

Author Comment

by:victorcosta85
ID: 33469082
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:cyberpunk71
ID: 33469347
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
 
LVL 16

Expert Comment

by:s8web
ID: 33469518
victorcosta,

Are you using a server language like php, coldfusion, or asp?
0
 
LVL 16

Expert Comment

by:s8web
ID: 33469839
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
 
LVL 16

Expert Comment

by:s8web
ID: 33469855
0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 33469867
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
 

Author Comment

by:victorcosta85
ID: 33472454
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question