JQuery http status 201处理
2016-10-23 09:01
148 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script src="js/jquery.min.js"></script> <script type="text/javascript"> function requestJson() { $.ajax({ type : 'post', url : 'http://localhost:8080/ajaxdemo/CreateUserServlet', dataType : 'text', //data : '{"id":"4","usercode":"44","password":"123"}', statusCode: { 201: function() { alert( "created" ); } }, complete : function( jqXHR, textStatus ) { alert("complete"); alert(jqXHR.status); //alert 201 alert(jqXHR.responseText ); alert(textStatus); } }); } </script> </head> <body> <input type="button" onclick="requestJson()" value="reqeust" /> </body> </html>
相关文章推荐
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- SpringMVC: 处理PUT和DELETE请求时报错:HTTP Status 405 - JSPs only permit GET POST or HEAD.
- HTTP Status 404 - No result defined for action XXXX and result success 处理
- HandleErrorAttribute只能处理httpStatusCode为500的异常(服务器异常)
- XMLHTTPRequest处理返回XML数据和jQuery处理返回XML数据比较
- jquery ajax XMLHttpRequest.status=0
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- ajax的status为201依然触发jquery的error事件的问题
- ExtJS中store自动加载数据的时候,在firebug下http status为Aborted时的处理方法
- 使用HTTP处理程序和jQuery在ASP.NET Web应用程序中的进行数据库操作
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- 应用HttpHandler, Json, JQuery, ASP.Net UserControl等技术处理 Ajax 的解决方案
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- Jquery statuscode处理
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- jQuery入门学习三:XMLHttpRequest处理xml格式的返回数据
- 在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- springmvc 异常001---在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- java开发中的HTTP Status 500错误处理
- Web开发中关于servlet产生HTTP Status 404 - /webMVC/servlet/MyReturnMessage.jsp的处理