C
chunghe
Hi,
This problem confused me a lot.
I made a simple demo below, click the button will trigger show( )
function, which insert image node to a DIV using innerHTML
( pl.innerHTML += '<IMG SRC=" + url + ">'; ), it works fine under
FF but under IE6, no images displayed at all.
I've tried to copy the generated code to another HTML file and it
works fine. I've also tried to copy the images to local, 2 to 3 images
will show randomly. IE6 seems to stop loading images at some point. If
I made IE cached images, IE will display those cached images.
My question is why the image didn't display and how to make this
example work under IE6.
I've tried to search topics about this question but nothing found. Any
comment/direction/references will be very helpful, thank you!
http://kitty.2y.idv.tw/~chfang/test.htm
<html>
<head>
<style>
img{border: 1px solid #ccc; margin: 5px; padding: 5px}
</style>
<script>
var url = ['http://farm3.static.flickr.com/
2076/2049894366_451d331b2d_s.jpg',
'http://farm3.static.flickr.com/2295/2049893606_46dc73fa6e_s.jpg',
'http://farm3.static.flickr.com/2211/2049892838_9d74e2f0ab_s.jpg',
'http://farm3.static.flickr.com/2069/2049106017_a13746be15_s.jpg',
'http://farm3.static.flickr.com/
2342/2049105161_9ab219365e_s.jpg'];
function show(){
var pl = document.getElementById('photolist');
var i;
pl.innerHTML = '';
for(i=0; i<=url.length-1; i++){
pl.innerHTML += '<IMG SRC=" + url + ">';
}
}
</script>
</head>
<body>
<a href="javascript:void(0)" onclick="show()">show</a>
<div id="photolist"></div>
</body>
</html>
This problem confused me a lot.
I made a simple demo below, click the button will trigger show( )
function, which insert image node to a DIV using innerHTML
( pl.innerHTML += '<IMG SRC=" + url + ">'; ), it works fine under
FF but under IE6, no images displayed at all.
I've tried to copy the generated code to another HTML file and it
works fine. I've also tried to copy the images to local, 2 to 3 images
will show randomly. IE6 seems to stop loading images at some point. If
I made IE cached images, IE will display those cached images.
My question is why the image didn't display and how to make this
example work under IE6.
I've tried to search topics about this question but nothing found. Any
comment/direction/references will be very helpful, thank you!
http://kitty.2y.idv.tw/~chfang/test.htm
<html>
<head>
<style>
img{border: 1px solid #ccc; margin: 5px; padding: 5px}
</style>
<script>
var url = ['http://farm3.static.flickr.com/
2076/2049894366_451d331b2d_s.jpg',
'http://farm3.static.flickr.com/2295/2049893606_46dc73fa6e_s.jpg',
'http://farm3.static.flickr.com/2211/2049892838_9d74e2f0ab_s.jpg',
'http://farm3.static.flickr.com/2069/2049106017_a13746be15_s.jpg',
'http://farm3.static.flickr.com/
2342/2049105161_9ab219365e_s.jpg'];
function show(){
var pl = document.getElementById('photolist');
var i;
pl.innerHTML = '';
for(i=0; i<=url.length-1; i++){
pl.innerHTML += '<IMG SRC=" + url + ">';
}
}
</script>
</head>
<body>
<a href="javascript:void(0)" onclick="show()">show</a>
<div id="photolist"></div>
</body>
</html>