做一个遍历头像的js程序,但是不兼容火狐,不加下面这段就兼容火狐了,不知道哪里的问题,请各位高手帮忙!
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder("D:\\工作区\\WebObject\\WebTest\\图片操作\\images");
var fc = new Enumerator(f.files);
while (!fc.atEnd())
{
var image = document.createElement("IMG");
image.alt = "";
image.src = fc.item();
image.style.cursor = "pointer";
image.style.border = "solid 1px blue";
image.onmouseover = function()
{
document.getElementById(img).src = this.src;
}
image.ondblclick = function()
{
document.body.removeChild(win);
}
body.appendChild(image);
fc.moveNext();
}
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder("D:\\工作区\\WebObject\\WebTest\\图片操作\\images");
var fc = new Enumerator(f.files);
while (!fc.atEnd())
{
var image = document.createElement("IMG");
image.alt = "";
image.src = fc.item();
image.style.cursor = "pointer";
image.style.border = "solid 1px blue";
image.onmouseover = function()
{
document.getElementById(img).src = this.src;
}
image.ondblclick = function()
{
document.body.removeChild(win);
}
body.appendChild(image);
fc.moveNext();
}
赞同,FF 现在是没有接口这个事情; 至于楼主实现是通过Windows 内核中的Script 引擎来实现的。所以,只能在window 平台上正常运行。