如何使用Jquery文件上传插件在HTTP请求期间获取500状态(How to get the 500 status during HTTP request using Jquery file upload plugin)
我需要有关如何触发500/404状态的帮助。 请帮助我们,如何使用jquery文件上传插件处理异常处理。
done : function(e, data) { alert(data.jqXHR.status); var errorCode = $.parseJSON(data.jqXHR.responseText).errorCode; alert("error:::"+errorCode); alert(`enter code here`"Status"+data.textStatus); }I Need help on how to trigger 500/404 status. kindly help us, how to handle exception handling using jquery file upload plugin.
done : function(e, data) { alert(data.jqXHR.status); var errorCode = $.parseJSON(data.jqXHR.responseText).errorCode; alert("error:::"+errorCode); alert(`enter code here`"Status"+data.textStatus); }最满意答案
完成是为了成功响应,您必须使用的错误失败
这是来自jQuery文档,但插件当然以相同的方式工作
var menuId = $("ul.nav").first().attr("id"); var request = $.ajax({ url: "script.php", type: "POST", data: {id : menuId}, dataType: "html" }); request.done(function(msg) { $("#log").html( msg ); }); request.fail(function(jqXHR, textStatus) { alert( "Request failed: " + textStatus ); });done is for successful responses, for errors you must use fail
This is from the jQuery documentation but the plugin certainly works the same way
var menuId = $("ul.nav").first().attr("id"); var request = $.ajax({ url: "script.php", type: "POST", data: {id : menuId}, dataType: "html" }); request.done(function(msg) { $("#log").html( msg ); }); request.fail(function(jqXHR, textStatus) { alert( "Request failed: " + textStatus ); });更多推荐
发布评论