I feel like a complete fool! I should know the answer to the Q:
How do I load an image with JS and replace the default image?
Some background: My final objective is to have a web site where it
is VERY difficult to copy images off the site. The first thing I
was going to do was force folks to turn on JavaScript so that I
could disable the right click pop up menu. To force this, I thought
I would have all the default images say that JavaScript is required
to view the images. The problem is that I cannot figure out for the
world in me how to load the good image. The page can be found here:
http://www.miltonstreet.com/index2.html
here are the code snips:
------------------------------------------------
[snip]
<body bgcolor="#FFFFFF">
<script language="JavaScript1.1">
<!--
TheImage = new Image();
TheImage.src = "images/RunningTheLine.jpg";
HomepageImage = document.images['hpImage'];
HomepageImage.src = TheImage.src;
//-->
</script>
[snip]
<img name="hpImage" src="images/njs-228x280.jpg" width="274"
height="336" border="0">
------------------------------------------------
Sam