【发布时间】:2013-06-06 08:24:56
【问题描述】:
我想在我的代码中进行最后一次 ajax 调用。
这是我的代码
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
<script>
function getCreateAccount() {
$.ajax({
type: "GET",
url: "/Account/Register/",
contentType: "application/json; charset=utf-8",
dataType: "json"
});
console.log($.ajax.mostRecentCall.args[0]);
}
</script>
</head>
<body>
</body>
</html>
但是当我在控制台中看到它说“TypeError: $.ajax.mostRecentCall is undefined”。
谢谢,
【问题讨论】:
-
尝试使用标志变量
-
使用
var ajaxcall = $.ajax({ type: "GET", ...并尝试是否可以使用ajaxcall变量来获取您需要的信息 -
这篇文章有帮助吗? stackoverflow.com/questions/4176956/…
-
这是 Jasmine 框架吗?你似乎没有加载 Jasmine
-
您想知道最近的发起调用,还是最近完成的?