Y
Yun
Hi folks,
I have a problem trying to delete some images that I previously load
in one array. My code looks like this :
// This is a global var
images = new Array();
function load_images() {
var time = new Date().getTime();
for (var i=0; i<=nimages, i++) {
delete images;
images = new Image();
images.src = image_path+i+".png?d="+time
}
At the end of the image name I set ".png?d=124151353546". This is
because I update the images every 5 minutes and the function is called
again. If I don't change the name of the image (using this trick ?
=....) the browser could think that the image is the same and it won't
change anything.
The problem I have using this code is that the image is not destroyed
by the browser (Firefox 4 in my case). After 3 or 4 hours, the web
site takes the whole RAM and I can't continue working.
Why delete images is not working ? or How could I do to destroy the
images I won't use again ?
Thank you for your help,
Yun
I have a problem trying to delete some images that I previously load
in one array. My code looks like this :
// This is a global var
images = new Array();
function load_images() {
var time = new Date().getTime();
for (var i=0; i<=nimages, i++) {
delete images;
images = new Image();
images.src = image_path+i+".png?d="+time
}
At the end of the image name I set ".png?d=124151353546". This is
because I update the images every 5 minutes and the function is called
again. If I don't change the name of the image (using this trick ?
=....) the browser could think that the image is the same and it won't
change anything.
The problem I have using this code is that the image is not destroyed
by the browser (Firefox 4 in my case). After 3 or 4 hours, the web
site takes the whole RAM and I can't continue working.
Why delete images is not working ? or How could I do to destroy the
images I won't use again ?
Thank you for your help,
Yun