Created
June 15, 2010 21:57
-
-
Save coryschires/439804 to your computer and use it in GitHub Desktop.
browser redirect script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note: this script depends on the jQuery browser plugin | |
// http://jquery.thewikies.com/browser/ | |
// place this at the very top of application.js | |
// outside of the document ready block to ensue | |
// it loads and initiates redirect as quickly | |
// as possible. | |
var browser_redirect = function() { | |
var os_param = $.os.name === 'mac' ? '?os=mac' : '?os=win'; | |
var bad_browsers = { | |
ie6: jQuery.browser.name == 'msie' && jQuery.browser.versionX < 7, | |
ff2: jQuery.browser.name == 'firefox' && jQuery.browser.versionX < 3, | |
safari3: jQuery.browser.name == 'safari' && jQuery.browser.versionX < 4 | |
}; | |
for (var b in bad_browsers) { | |
if (bad_browsers[b]) { | |
return window.location = "http://" + window.location.host + "/browser_redirect.html" + os_param | |
} | |
} | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cody where it says window.location = put the URL for your redirect page