Detect Internet Explorer


SUBMITTED BY: TheSwarm

DATE: Oct. 22, 2015, 3:20 p.m.

FORMAT: Text only

SIZE: 498 Bytes

HITS: 1525

  1. <script type="text/javascript">
  2. if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
  3. var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
  4. if (ieversion>=8)
  5. document.write("You're using IE8 or above")
  6. else if (ieversion>=7)
  7. document.write("You're using IE7.x")
  8. else if (ieversion>=6)
  9. document.write("You're using IE6.x")
  10. else if (ieversion>=5)
  11. document.write("You're using IE5.x")
  12. }
  13. else
  14. document.write("n/a")
  15. </script>

comments powered by Disqus