브라우저 버전 과소 판단

3920 단어
(function (window) {
   function getBrowserInfo () {
    var agent = navigator.userAgent.toLowerCase()
    var regStrff = /firefox\/[\d.]+/gi
    if (agent.indexOf('firefox') > 0) {
      return agent.match(regStrff)
    }
  }
  var browser = getBrowserInfo()
  var verinfo = (browser + '').replace(/[^0-9.]/ig, '')
  var theUA = window.navigator.userAgent.toLowerCase()
  if ((theUA.match(/msie\s\d+/) && theUA.match(/msie\s\d+/)[0]) || (theUA.match(/trident\s?\d+/) && theUA.match(/trident\s?\d+/)[0])) {
    var ieVersion = theUA.match(/msie\s\d+/)[0].match(/\d+/)[0] || theUA.match(/trident\s?\d+/)[0]
    if (ieVersion < 9 || verinfo < '56') {
      var str = ' low ,  :( '
      var str2 = " : "
      document.writeln("
" 
+
"

"

+ str + '

'

+ str2 + '')
document.execCommand('Stop')
}
}
}(window))

좋은 웹페이지 즐겨찾기