1<script>2 functionDetectie () {3 varUA =window.navigator.userAgent;4 5 varMSIE = Ua.indexof (' MSIE '));6 if(Msie > 0) {7 //IE ten or older = Return version number8 //return parseint (ua.substring (MSIE + 5, Ua.indexof ('. ', MSIE));9 return true;Ten } One A varTrident = Ua.indexof (' trident/')); - if(Trident > 0) { - //IE one by one = Return version number the //var rv = ua.indexof (' rv: '); - //return parseint (ua.substring (rv + 3, Ua.indexof ('. ', RV)); - return true; - } + - varEdge = Ua.indexof (' edge/'); + if(Edge > 0) { A //Edge (IE 12+) = Return version number at //return parseint (ua.substring (Edge + 5, Ua.indexof ('. ', Edge)); - return true; - } - - //Other browser - return false; in } - to functionalert_browser_version () { + if(Detectie ()) { -Alert ("Browser Error:\nwe is strongly recommend you visit the website via Chrome or Firefox instead of IE."); theWindow.location.href = "http://hkw20016704.hbap.adroot.hsbc:8000/cr/index/"; * return false; $ }Panax Notoginseng } -</script>
<body onload= "alert_browser_version ()" >....</body>
Detect IE Browser by using JavaScript