ok, heres my problem... internet explorer is stupid with some of my code, if running less than v5.5, therefore i want to test the browser...
obviously i should be able to do this:
<script language="JavaScript" type="text/javascript"><!--
//--><img src=http://www.codingforums.com/archive/index.php/"graphics/seal2.gif" width=150 height=150 border = 0><!--
if (!(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion < "5.0"))
{
document.write('<img src=http://www.codingforums.com/archive/index.php/"graphics/seal1.png" width=150 height=150 border = 0>')
}
else
{
document.write('<img src=http://www.codingforums.com/archive/index.php/"graphics/seal2old.gif" border = 0>')
}
//-->
</script>
unfortunately, the idiot at microsoft made version a big long string, and instead of starting the string with the current version, all versions above 4.0 begin with 4.0(compatable
is there a simple way to actually test if the users browser is below v 5.5?
the real issue is attempting to use the js png fix, which only works for 5.5 and above
Willy Duitt
02-03-2005, 09:35 PM
How about the non-idiot method of checking for both document.all && !document.getElementById ??
Philip M
02-04-2005, 07:28 AM
IE5 supports document.all but not document.getElementById
so
if (document.all && !document.getElementById) {
... IE browser version is lower than 5.5.
Puffin the Erb
02-04-2005, 08:18 PM
This is incorrect. IE4 supports document.all but not document.getElementById().
IE 5 and higher support document.all and document.getElementById().
Testing for navigator properties is unreliable due to browser spoofiing.
It would be better to test for support of the specific capability you are trying to work with rather than try to identify versions of a browser.
What property is causing the problem?