Forum Moderators: open
Note that if the img is created within an onclick of a <p>, it works fine, but not if it's created within the onclick of an <a>.
The browser is IE 6.0.28. In Netscape 6.1, the behavior is similar, except once the image file appears successfully once, then subsequent image creations with that file work fine. Would these be caching issues?
Here's a test .html file that exhibits the problem when executed from my localhost; it relies on one image file in the same directory.
Thanks very much for any help!
<html>
<head>
<script type="text/javascript">
function makeImage() {
var img = new Image()
img.src = "edit.gif"
img.border = 1
document.body.appendChild(img)
}
</script>
</head><body>
<p>
<a hRef="javascript: void 0" onclick="makeImage();">
Click to create image from "a tag onclick". Image does not appear
</a>
</p>
<p id="p1" onclick="makeImage();">
Click this to create image from "p tag onclick". Image appears
</p>
</body>
</html>