G
Guest
Can anyone help me with this problem:
I am trying to preload images, but I am not doing them the traditional way
(which works fine):
<script language=javascript>
var myImage = new Image()
myImage.src = 'mylocalfile.gif'
</script>
..... in the html body
<img src = myImage.src </img>
Instead, I need to use the results of an aspx page (which writes out an
image to the response stream):
<script language=javascript>
var myImage = new Image()
myImage.src = 'http://localhost/makemeanimage.aspx?size=120'
</script>
..... in the html body
<img src = myImage.src </img>
This doesn't throw an error, but the image is always missing. It always
works if I use a local image file, but not an image served from the aspx page.
Strangely enough, the following DOES work though:
<img src = 'http://localhost/makemeanimage.aspx?size=120' </img>
I could just do this, but I need to use the images in a rollover, which
would be very slow on modem speed connections if the page is hit every time
the rollover occurs.
Does this mean that I can't preload images served from an aspx page in
javascript?
using vs 2003 windows xp ie6
thanks
sorry about the double post
I am trying to preload images, but I am not doing them the traditional way
(which works fine):
<script language=javascript>
var myImage = new Image()
myImage.src = 'mylocalfile.gif'
</script>
..... in the html body
<img src = myImage.src </img>
Instead, I need to use the results of an aspx page (which writes out an
image to the response stream):
<script language=javascript>
var myImage = new Image()
myImage.src = 'http://localhost/makemeanimage.aspx?size=120'
</script>
..... in the html body
<img src = myImage.src </img>
This doesn't throw an error, but the image is always missing. It always
works if I use a local image file, but not an image served from the aspx page.
Strangely enough, the following DOES work though:
<img src = 'http://localhost/makemeanimage.aspx?size=120' </img>
I could just do this, but I need to use the images in a rollover, which
would be very slow on modem speed connections if the page is hit every time
the rollover occurs.
Does this mean that I can't preload images served from an aspx page in
javascript?
using vs 2003 windows xp ie6
thanks
sorry about the double post