Created
July 21, 2016 06:05
-
-
Save webbingstudio/1b2429ce03ade3bb7be59c0638613001 to your computer and use it in GitHub Desktop.
modernizrでの判定もできないSnowLeopardのSafari5に対し、SVGsupport有無の判定を行う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(function(){ | |
var userAgent = window.navigator.userAgent.toLowerCase(); | |
if (userAgent.indexOf('safari') != -1) { | |
var version = userAgent.match(/^.*\sversion\/(\d+)\.\d.*$/); | |
if ( parseInt( version[1] ) < 9 ){ | |
console.log('no SVG'); | |
} else { | |
console.log('support SVG'); | |
} | |
} | |
}); // end $(function | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Safariのバージョンが2桁になった場合もいちおう対応してる