Tell user which version of IE they have?
#4
Scooby Regular
Thread Starter
Thanks SJ, unfortunately i work with a bunch of idiots and they wouldn't have a clue what this meant.
Do you know of a way to make it display it something like "You have Internet explorer 5.5" and so on?
CHeers
Andy
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
CHeers
Andy
#5
Andy,
Stolen earlier:
edited to add: stick this between <body> ---- </body>
<SCRIPT LANGUAGE="JavaScript">
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1)
{
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1)
{
bVer = useragent.substring(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape")
{
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5)
{
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}
document.writeln('<b>Browser Name: </b>' + bName + '<br>');
document.writeln('<b>Browser Version: </b>' + bVer + '<br>');
</script>
Rich
[Edited by SJ_Skyline - 1/12/2004 11:08:38 AM]
Stolen earlier:
edited to add: stick this between <body> ---- </body>
<SCRIPT LANGUAGE="JavaScript">
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1)
{
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1)
{
bVer = useragent.substring(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape")
{
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5)
{
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}
document.writeln('<b>Browser Name: </b>' + bName + '<br>');
document.writeln('<b>Browser Version: </b>' + bVer + '<br>');
</script>
Rich
[Edited by SJ_Skyline - 1/12/2004 11:08:38 AM]
Thread
Thread Starter
Forum
Replies
Last Post
shorty87
Full Cars Breaking For Spares
19
22 December 2015 11:59 AM
Pro-Line Motorsport
Car Parts For Sale
2
29 September 2015 07:36 PM
shorty87
Wheels And Tyres For Sale
0
29 September 2015 02:18 PM