Skip to content

Instantly share code, notes, and snippets.

@nfroidure
Last active December 19, 2015 21:18
Show Gist options
  • Save nfroidure/6019151 to your computer and use it in GitHub Desktop.
Save nfroidure/6019151 to your computer and use it in GitHub Desktop.
Supporting old Internet Explorer versions easily
<html><head>
<!--[if lt IE 8]><script type="text/javascript">
alert('Ooops, you are using an old browser. Please come back with a more recent one.');
document.location.href="http://thewebyoumiss.com/?referer=example.com"
+"&preview=example.com/images/preview.png"
+"&preview=youtube.com/qs545qsd";
</script><![endif]-->
</head><body>
<p>The fantastic app you could miss with old browsers.</p>
</body></html>
@bloodyowl
Copy link

<!--[if lt IE 8]><script type="text/javascript">/*1*/</script><![endif]-->

1.

;(function(win){

  var doc = win.document
    , styles = doc.getElementsByTagName("link") 
    , l = styles.length 
    , item

  while(--l >= 0) {
    item = styles[l]
    if(item.rel != "stylesheet") continue
    item.parentNode.removeChild(item)
  }

})(this.window)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment