javascript中new ActiveXObject("Scripting.FileSystemObject")问题

来源:百度知道 编辑:UC知道 时间:2024/06/27 07:33:10
在javascript中实例fso=new ActiveXObject("Scripting.FileSystemObject") 的时候会提示用户"在此页上的ActiveX控件和本页上的其他部分的交互可能不安全。你想允许这种交互么?",选择有两个是和否,如果选是fso被成功实例,以后的其他操作没有问题。但是如果选否,将不被实例,并且如果想再次实例的时候也不可以,只有在刷新整个页面的时候才会提示,我是用F5刷新管用,用document.execCommand('refresh',false,0)或者是reload()刷新都不管用。请问谁知道这是为什么,有没有在选否以后不刷新页面从新实例的办法?
代码:
var fso;
try{
fso=new ActiveXObject("Scripting.FileSystemObject");
}catch(e){}
不会吧,window.reload()重新加载页面应该可以啊,再试试。

清除缓存,重新加载页面<%response.expires = 0 response.expiresabsolute = now() - 1 response.addHeader "pragma","no-cache" response.addHeader "cache-control","private" Response.cachecontrol = "no-cache" %>

再试试这个
回答者:听到浪涛 - 试用期 一级 2-9 10:34

Scripting.FileSystemObject是不安全的COM组件,不应当在客户端页面脚本中使用。
回答者:graych - 试用期 一级 2-9 11:38

我试过了` 都不好使 `

不会吧,window.reload()重新加载页面应该可以啊,再试试。

清除缓存,重新加载页面<%response.expires = 0 response.expiresabsolute = now() - 1 response.addHeader "pragma","no-cache" response.addHeader "cache-control","private" Response.cachecontrol = "no-cache" %>

再试试这个

Scripting.FileSystemObject是不安全的COM组件,不应当在客户端页面脚本中使用。