detect IE7 with JavaScript


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type=”text/javascript”>
  2. if (window.XMLHttpRequest) {
  3. //IE 7, mozilla, safari, opera 9
  4. } else {
  5. // IE6, older browsers
  6. }
  7. </script>
  8.  
  9. <script type=”text/javascript”>
  10. if (typeof document.body.style.maxHeight != “undefined”) {
  11. // IE 7, mozilla, safari, opera 9
  12. }
  13. else {
  14. // IE6, older browsers
  15. }
  16. </script>
  17.  
  18. <script type=”text/javascript”>
  19. isIE7 = false;
  20. /* @cc_on
  21. @if (@_jscript_version &;gt;= 5.7)
  22. isIE7 = true;
  23. @end
  24. @*/
  25. </script>
  26.  
  27. <script type=”text/javascript”>
  28. if((document.all)&&(navigator.appVersion.indexOf(”MSIE 7.”)!=-1)){
  29. document.write(”IE 7 “);
  30. }
  31. </script>

URL: http://blog.t8d.de/2007/01/09/ie7-und-javascript-sicher-erkennen/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.