Solved

detect safari version 6.1 and above

Posted on 2014-02-17
1
198 Views
Last Modified: 2014-03-11
Hi

How can i detect safari versions 6.1 and above with JS

Thanks
0
Comment
Question by:coolispaul
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39864993
var strVersion = navigator.userAgent.match(/\sVersion\/([^\s]*)/).pop();
var dVersion = strVersion.replace(/([^.]+).([^.]).?([^.])/,"$1.$2$3") * 1;
var test = dVersion > 6.1; // true or false

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now