Created
December 19, 2015 22:18
-
-
Save EtherTyper/f2e5d6cfa5946cb48977 to your computer and use it in GitHub Desktop.
IE discrimination template [For Larry]
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
<!-- BrowserCheck credit Michael Bleidistel !--> | |
<!-- Example (C) Eli Bradley, MIT License !--> | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Not My First Web Page</h1> | |
<p id="demo">My first paragraph tho.</p> <!-- Replaced !--> | |
<script> | |
function BrowserCheck() //Returns an array of [name,number] | |
{ | |
var N= navigator.appName, ua= navigator.userAgent, tem; | |
var M= ua.match(/(opera|chrome|safari|firefox|msie|trident)\/?\s*(\.?\d+(\.\d+)*)/i); | |
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) {M[2]=tem[1];} | |
M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?']; | |
return M; | |
} | |
document.getElementById("demo").innerHTML = (BrowserCheck()[0]+" "+BrowserCheck()[1]); //returns name and number | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're welcome, Larry!
Now get down to frustrating those MSIE 5.0 users!