How to get the URL of a xmlhttp request (AJAX)

╄→гoц情女王★ 提交于 2019-11-29 17:29:04

I'm not sure how much access you have to the code but you can over-ride XMLHttpRequest.open and hook the url there.

XMLHttpRequest.prototype.open = (function(open) {
  return function(method,url,async) {
      console.log('the outgoing url is ',url);
      open.apply(this,arguments);
    };
})(XMLHttpRequest.prototype.open);

Here is a FIDDLE.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!