简体   繁体   English

在不知道请求的情况下如何获得Ajax响应?

[英]How can I get a Ajax-Response without knowing the Request?

I need to have the Response on Ajax-Requests made by the Webpage I'm in, but I have no access to the Request. 我需要由我所在的网页对Ajax请求做出响应,但是我无权访问该请求。 Reason: The request is stored in a local variable and I can't change the code where the variable is available (because of update-issues). 原因:请求存储在本地变量中,并且我无法在变量可用的地方更改代码(因为有更新问题)。 The request is sent via XMLHttpRequest (and NOT jquery :-( ). 该请求通过XMLHttpRequest发送(而不是jquery :-()。

I know, this all sounds like im producing crap-code, but it's all on customer-wishes :-/ 我知道,所有这些听起来都像是即时消息在生成废话代码,但这全都是客户希望的:-/

To have it resolved: It is not possible. 解决该问题:这是不可能的。 Without access to the XHR-Object there is no possibility to get knowledge of it. 如果无法访问XHR-Object,就不可能了解它。 jQuery saves the XHR globally, so they can provide global event handlers. jQuery全局保存XHR,因此它们可以提供全局事件处理程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM