如何修改ActiveXObject的JS构造函数? [英] How to modify ActiveXObject JS constructor?
问题描述
我需要换一个IE浏览器的AJAX请求时,它发生在通知我。也就是我需要知道打开时,呼吁这样的:
I need to wrap an IE ajax request to notify me when it happens. ie i need to know when open is called on this:
VAR XHR =新的ActiveXObject(Microsoft.XMLHTTP);
var xhr = new ActiveXObject("Microsoft.XMLHTTP");
只有这样,才能做到这一点(我认为)是落实ActiveXObject的构造代理开放调用真正的构造函数/对象。你能帮我做到这一点?
The only way to do that(i think) is to implement the ActiveXObject constructor to proxy open calls to the real constructor/object. Can you help me do that?
也: 我不需要创建实际XHR对象,所以请不要告诉我使用的是X架构,因为它很容易。
also: i dont need to create the actual xhr object, so please dont tell me to use X framework because its easy.
所有我需要知道的是,当打开被称为(而不是由我的code)的MS XHR对象。
all i need to know is when open is called (not by my code) on an MS xhr object.
非常感谢你!
推荐答案
由于OP已经发布了类似的问题,我发布了一个答案这也恰好契合的这个的问题,他问我链接到我的答案,而不是重复它在这里。
Since the OP has posted a similar question, and I posted an answer which also happens to fit this question, he asked me to link to my answer, instead of repeating it here.
- 问:扩展在JavaScript中的ActiveXObject
- 答:<一href="http://stackoverflow.com/questions/797960/extending-an-activexobject-in-javascript/798611#798611">A插入式透明包装
MSXML2.XMLHTTP
这篇关于如何修改ActiveXObject的JS构造函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!