访问一个jQuery的Ajax请求的URL在回调函数 [英] Access the URL of an jQuery Ajax Request in the Callback Function

查看:156
本文介绍了访问一个jQuery的Ajax请求的URL在回调函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,我可以看到被请求的URL,当我做一个Ajax请求与jQuery?

Is there a way that I can see the URL that was requested when I do an Ajax request with jQuery?

例如,

var some_data_object = { ...all sorts of junk... }
$.get('/someurl.php',some_data_object, function(data, textStatus, jqXHR) {
   var real_url = ? # <-- How do I get this
})

我如何可以访问jQuery的实际使用,使请求的网址是什么?也许 jqHXR 的某些方法/属性?我找不到它的文件中。

How can I access the URL that jQuery actually used to make the request? Perhaps some method/property of jqHXR? I couldn't find it in the documentation.

感谢。

推荐答案

在设置方法成功破发点,然后看

Set a break point in success method, then watch

this.url

是真实的URL的请求。

is the real url for the request.

这篇关于访问一个jQuery的Ajax请求的URL在回调函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆