JavaScript ActiveXObject [英] JavaScript ActiveXObject
问题描述
var AXobj = new ActiveXObject(WScript.Shell);
AXobj.SendKeys(key);
但错误控制台说ActiveXObject是未定义的。在这之后,我试了一下:
var AXobj = new DOMParser(WScript.Shell);
AXobj.SendKeys(key);
但是,错误控制台说:
< blockquote>
错误:未被捕获的异常:[Exception ...Security errorcode:1000nsresult:0x805303e8(NS_ERROR_DOM_SECURITY_ERR)location:file:/// C:/ Documents%20and %20Settings / Guest / Desktop / stuff / html / GML%20to%20JS.html Line:335]
我不想只用于SendKeys ActiveXObject。我需要它更多的东西(如写在文件中...),而我使用FireFox而不是IE浏览器的原因是,FireFox支持HTML5。
它仅适用于IE( thank goodness ) 。
它也有一些严重的安全问题,这是其他浏览器供应商从未采用的一个重要原因。
I have a queastion about ActiveXObject in javascript. I have tryed this code in Mozila FireFox 6.0.2
var AXobj = new ActiveXObject("WScript.Shell");
AXobj.SendKeys(key);
But the error console says that ActiveXObject is undefined. After that, I have tryed this:
var AXobj = new DOMParser("WScript.Shell");
AXobj.SendKeys(key);
But then, the error console says:
Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "file:///C:/Documents%20and%20Settings/Guest/Desktop/stuff/html/GML%20to%20JS.html Line: 335"]
By the way, i don't want to use ActiveXObject only for SendKeys. I need it for more stuff (like writing in file... ) AND, the reason i use FireFox instead of IE is that FireFox supports HTML5.
ActiveX is a proprietary technology only supported by Microsoft...
It will only work in IE (thank goodness).
It also has some serious security concerns which is a big reason it was never adopted by other browser providers.
这篇关于JavaScript ActiveXObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!