解决方案 »
- Servlet登录验证出问题了!求解!
- struts2.action.extension 配置
- dwr返回list,怎么填充到select
- 大家一起来讨论oop啊 我先提几个问题
- Jnative取得dll中的属性的问题
- 这是什么错误啊?no protocol : hibernate-configuration-3.0 dtd
- 外行请教:JAVA系统大并发的性能保证措施?
- 请教:servlet问题。
- 关于string转换成byte后字符串改变的问题
- 刚学struts2中出问题There is no Action mapped for namespace and action name
- 用SWT或AWT截多边形的图。
- 关于log4j,谁能带我入个门啊?
type: "GET",
url: "test.js",
dataType: "script"
timeout:"毫秒"
});
textStatus可以是timeout
error:function (XMLHttpRequest, textStatus, errorThrown) {
}
type: "POST",
timeout : 15000,
error : function(XMLHttpRequest, textStatus, errorThrown) {
if(textStatus == 'timeout') {
alert("您的操作请求已经超时");
} else {
alert("其他错误。");
}
}
}
多谢,意思是用$.post是不可以的?;
我用$.ajaxSetup({
url: "/xmlhttp/",
global: false,
type: "POST"
});
试试
我自己解决了
$.ajaxSetup({
timeout : 2000,
error : function(XMLHttpRequest, textStatus, errorThrown) {
if(textStatus == 'timeout') {
alert("您的操作请求已经超时");
} else {
alert("其他错误。");
}
}
}); function getMy(){
var id="213123123";
var url="<%=request.getContextPath()%>/transaction/getByIdCommodity?id="+id;
$.post(url,{},function(returnData,status){
if(status=="success"){
alert(status);
}
},"json");
}
http://www.w3school.com.cn/jquery/ajax_ajaxsetup.asp