ajax调用中没有响应状态,不确定原因
No response status in ajax call not sure why
我有以下ajax调用这是我的spring mvc应用程序..
alert("ready");
$.ajax({
type: "GET",
url: document.location.toString()+ "/dashboard",
success: function(response) {
alert(response);
alert(response.status);
$("#frameBody").contents().find("html").html(response);
// we have the response
if(response.status == "SUCCESS") {
alert(response);
// do nothing..
// check for no content... if there is content... replace iframe
// $("#frameBody").attr('src', jsonObj.url);
// $(""#frameBody").contents().find("html").html(response);
}
else {
// do nothing yet
}
},
error: function(e){
$("#errors").attr("style", "display:inline")
$('#errors').html(e.responseText);
window.setTimeout("fadeErrorsDiv();", 5000);
}
});
my MVC controller:
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
@ResponseStatus(value=HttpStatus.OK)
public String dashboard(Model model, HttpServletRequest req) {
int i = 0;
return "login";
}
我的问题是,我看不出为什么这没有产生我期望的响应状态?当我检查响应时,结果是undefined。javascript中的状态?知道为什么
参见JQuery .get文档。看起来你成功回调中的"response"对象实际上是"login"。因此,您实际上是在尝试执行"login".status。
相关文章:
- 在这个使用hasOwnProperty的对象扩展程序中有一个错误,I'我不确定那个bug是什么,也不确定这个扩展
- HTML5 Canvas toDataURL(“image/png”)适用于一些绘画,而有些则不然,不确定原因
- 不确定我在PHP AJAX中使用的是什么开发模式
- 传递数量不确定的可能嵌套的对象属性
- 不确定react.js的异步执行时间
- 使用JavaScript进行即时验证-不确定从哪里开始
- 使用动态键返回不可变状态
- Javascript正则表达式失败,但不确定原因
- 如何在 html 和 javascript 中显示隐藏不确定的循环进度条
- 不确定如何标记 OnClick 事件
- Getting a Maximum call stack size exceeded error,但不确定原因
- 意外的令牌,但不确定原因
- jQuery识别页面加载上的单选按钮的不正确状态,当单选值=“0”时;否”;并且两个无线电都没有被选择
- 统一JS单选按钮不更改状态
- onclick启动打开弹出窗口的javascript-不确定函数调用
- JQuery 选择子元素(如果不是直接在父元素下,则不确定是否可选)
- 粗花呢位置完成后,将对象淡入到不可见状态
- 样式为 -webkit-外观的单选按钮:复选框:Chrome 中的不确定状态
- ajax调用中没有响应状态,不确定原因
- 复选框不确定状态逻辑