|
General Details
|
|
JavaScript
|
|
Posted 134 Days Ago
|
|
360 Views
|
|
Received 2 Ratings
|
|
Advanced Browser And Operating System Detection
Description
I wrote this a while back and will update for Vista soon.
Technical
Simply save into a file, and this will detect which browser or operating system the user is using.
So, to see if the browser is using IE:
if (isIE) {
alert("IE User :P");
}
Or for FireFox:
if (isMoz) {
alert("FireFox Yay!");
}
Windows:
if (isWin) {
alert("Windows");
}
or even:
if (isWin95) {
alert("Update, jeez!");
}
You can look through the source to see what else you can detect for now, and I will add a list soon.
Source Code
Comments
| Please login to post comments. |
|
|
I found it a lot easier to just have:
<script type="text/javascript" src="detect.js"></script>
And through the code simply just use:
if (isIE) {
//do crap
}
It's cleaner IMHO.
|
|
|
Thats quite cool. I like how many browsers it can potential detect. Nice work there. But i feel you should have encapsulated it a lot more, you have so many global variables and code in the main namespace (by that i mean not inside a function or class).
I would have rated it a little higher if it was inside a class, or inside a single function making it easy to use such as:
get_browser();
|
More "JavaScript" Source Codes By This Author
Recently Posted "JavaScript" Source Codes
Recently Rated "JavaScript" Source Codes
|