Hello,
I've written a function which enumerates all the images in a folder and then shows them on a web page, using the innerhtml function. The code goes like this:
This is then called in the onload event of the pages body tag, but for some reason, the images don't show. Instead, I just get a load of placeholders. The path is fine - it's definitely finding the images properly, my browser just won't show them. If I bring up the right click properties of any of the images, all the options (address etc) are "Not Available". I'm using IE7 under Vista and I've put this site in my trusted sites, so I'm pretty sure it's not a security problem.
Has anybody got any ideas?
Thanks,
NFI
I've written a function which enumerates all the images in a folder and then shows them on a web page, using the innerhtml function. The code goes like this:
Code:
function draw_gallery(galPath){
var fso;
var fldr;
var sHTML = "";
//alert(galPath);
fso = new ActiveXObject("Scripting.FileSystemObject");
fldr = fso.GetFolder(galPath);
eFiles = new Enumerator(fldr.Files);
for (;!eFiles.atEnd();eFiles.moveNext())
{
sHTML += "<img src='" + galPath + eFiles.item().name + "' alt='" + eFiles.item().name + "'><br>";
}
alert(sHTML);
document.getElementById('gallery').innerHTML = sHTML;
}
This is then called in the onload event of the pages body tag, but for some reason, the images don't show. Instead, I just get a load of placeholders. The path is fine - it's definitely finding the images properly, my browser just won't show them. If I bring up the right click properties of any of the images, all the options (address etc) are "Not Available". I'm using IE7 under Vista and I've put this site in my trusted sites, so I'm pretty sure it's not a security problem.
Has anybody got any ideas?
Thanks,
NFI