Skip to content

Instantly share code, notes, and snippets.

@nocean
Created July 18, 2015 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocean/22f14760701fb0abb956 to your computer and use it in GitHub Desktop.
Save nocean/22f14760701fb0abb956 to your computer and use it in GitHub Desktop.
/*******************************************************************************
OLDIE - or Old IE. A script that finds the version of IE you're using,
and redirects if lower than the set parameter.
[[ Created by Ryan McLaughlin, www.DaoByDesign.com ]]
*******************************************************************************/
var browser = navigator.appName
var ver = navigator.appVersion
var thestart = parseFloat(ver.indexOf("MSIE"))+1 //This finds the start of the MS version string.
var brow_ver = parseFloat(ver.substring(thestart+4,thestart+7)) //This cuts out the bit of string we need.
if ((browser=="Microsoft Internet Explorer") && (brow_ver < 6)) //By default the min. IE ver is set to 6. Change as desired.
{
window.location="http://www.example.com/oldie.html"; //URL to redirect to.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment