Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>test for i.e. less than v5.5

test for i.e. less than v5.5

singedpiper
02-03-2005, 08:39 PM
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 ??

singedpiper
02-03-2005, 09:39 PM
exlain? how

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?


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

can not call click() in Firefox or Mozilla
Trouble with Status/Progress Window
tool tips, alt tags, and javascript
HELP!! Browser Detection with JScript
Window.Opener.Document.getElementById("name").innerHTML - update problems
Inserting Multiple Records into MSaccess Database
How to find local user settings with Javascript
validate a textbox

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics