在mscript中通过external.get_tab取得的Window对象问题 |
Jd0A0j http://www.numino.net 希望有人指点迷津: 2O7RS4 http://www.numino.net 我在mscript中,通过var oWin=external.get_tab(%max_security_id, external.cur_sel);语句取得了window对象,但使用中发现,这时的oWin和Javascript中的Window对象还是有不同,我发现以下问题: 9c3Oe6 http://www.numino.net 1、mscript中,oWin中使用event对象(如使用语句oWin.event.altKey检测Alt键是否按下)会出错,提示“缺少对象”,在Javascript中用window.event.altKey就不会。 aJR84K http://www.numino.net 2、mscript中,处理框架时,oWin.frames(i).document ... 会出错,在Javascript中用window.frames(i).document ... 就不会 (晕,一用[]就变Discuz!代码了,只能用()代替) 24ADi0 http://www.numino.net Re: 试试 oWin.contentWindow.document gl6CM9 http://www.numino.net 因为我调用FSO及Word对象进行文件写入操作,Javascript中会有安全限制,不用mscript有什么好方法? uL90bx http://www.numino.net 要不只能做面COM控件了 Ds0k5B http://www.numino.net Re: 5kV145 http://www.numino.net mscript 的执行方式是比较特别的,可以想像为把 dom 拿到某个地方,执行 mscript,然后放会页面。之后 dom 发生的事不会再牵涉 mscript 的了。 PisVLf http://www.numino.net 普通 script 用 maxthon 插件命令便能使用 FSO: P6Z1Em http://www.numino.net var oFSO=external.max_activex(%max_security_id, 'Scripting.FileSystemObject'); jsYELP http://www.numino.net 当然用完最好立即跟手清除,避免留在页面上。
|
|