Posted by Toby Inkster on 09/17/05 03:33
Morgan wrote:
> <script type="text/javascript">
> <!--
> if( navigator.appName=="Microsoft Internet Explorer")
> {
> document.write("<img src='directory/image.gif' />"); //put gif
> location here
> }
> else
> {
> document.write("<img src='directory/image.png' />");// put png location
> here
> }
> //-->
> </script>
And anyone with a non-Javascript browser gets diddly-squat.
Better:
<img id="myimg1" src="flibble.png" alt="Flibble">
<!--[if IE]>
<script type="text/javascript">
document.getElementById('myimg1').src='flibble.gif';
</script>
<![endif]-->
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|