ActiveXObject(“Scripting.FileSystemObject”) 不适合我
我想将特定文件夹的文件名添加到 JS 数组中,但没有任何反应:
var pics = new Array();
var x;
var fs = new ActiveXObject("Scripting.FileSystemObject");
alert('x');
var fo = fs.GetFolder(Server.MapPath("C:\wamp\www\newsite\ErfanGhiasiPanel\Slider Images"));
for (x in fo.files){
pics.push(x.Name);
}
例如,当我
alert('something')
在 var fs = new ActiveXObject... 或下一行之后插入一个时,它不会出现。 你们觉得呢?
谢谢
I want to add names of files of a specific folder to an JS's array, but nothing happens:
var pics = new Array();
var x;
var fs = new ActiveXObject("Scripting.FileSystemObject");
alert('x');
var fo = fs.GetFolder(Server.MapPath("C:\wamp\www\newsite\ErfanGhiasiPanel\Slider Images"));
for (x in fo.files){
pics.push(x.Name);
}
For instance, whet I insert an
alert('something')
after var fs = new ActiveXObject... or next lines, it won't appear.
What you guys think?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设 JScript + Classic ASP 由于
MapPath
(在您的情况下不需要),您需要转义路径字符串;Assuming JScript + Classic ASP due to the
MapPath
(which you dont need in your case) you need to escape the path string;