Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Created January 25, 2012 00:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pamelafox/1673684 to your computer and use it in GitHub Desktop.
Save pamelafox/1673684 to your computer and use it in GitHub Desktop.
IE ChromeFrame conditional prompt and alert
<!--[if lt IE 7]>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>
// The conditional ensures that this code will only execute in IE,
// Therefore we can use the IE-specific attachEvent without worry
window.attachEvent("onload", function() {
CFInstall.check({
mode: "overlay"
});
});
</script>
<![endif]-->
<!--[if lt IE 9]>
<div class="alert-message warning">
<span class="icon-reminder"></span>
Our site works best in <a href="http://browsehappy.com/">modern browsers</a>.
We recommend upgrading or installing the
<a href="http://www.google.com/chromeframe">Google Chrome Frame</a> plugin for the best experience.
</div>
<![endif]-->
@chriseppstein
Copy link

how did you configure the page head to correspond to this?

@pamelafox
Copy link
Author

I configured it per the ChromeFrame docs, the standard:

I tested in browserstack and it worked as I expected.

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