...

View Full Version : Conditional loading of a graphic



steveg
02-09-2007, 03:06 PM
Hi

Im using the following function to determine the operating system, however i want to supress loading of graphics if the OS is CE

function checkOS() {
if(navigator.userAgent.indexOf('CE') != -1)
{ var OpSys = "CE"; }
else { var OpSys = "WIN"; }
return OpSys;
}

what im looking for is something like

if checkOS = "WIN"
<img src= ... etc
else
&nbsp;
end if

its just the syntax im looking for really, and its got to run on a straight html page not asp.

Thanks

Steve.

david_kw
02-09-2007, 05:27 PM
Try



<body>
<script type="text/javascript">
if (checkOS() == "WIN") {
document.write("<img src= ... etc>");
} else {
document.write("&nbsp");
}
</script>
</body>


david_kw



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum