Skip to content

Instantly share code, notes, and snippets.

@searls
Created June 9, 2011 20:23
Show Gist options
  • Save searls/1017637 to your computer and use it in GitHub Desktop.
Save searls/1017637 to your computer and use it in GitHub Desktop.
What to do when you can't edit the markup, but the markup doesn't have a doctype defined, and you don't want IE7/8 to enable quirks mode.
if($.browser.msie && document.compatMode === 'BackCompat') {
document.write('<!DOCTYPE html>'+document.documentElement.outerHTML);
history.go(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment