我知道在jQuery ajax有工具來檢測錯誤,但我想要的是如何描述是什麼問題? 404,沒有互聯網連接,內部服務器錯誤或其他?jQuery ajax錯誤的描述
這是我簡單的程序
<script type="text/javascript" charset="utf-8" src="http://jquery.local/jquery-1.7.2.min.js"></script>
<script>
function Create_new_event()
{
url = "missing.php";
$.post(url, {
}, function(hasil) {
alert (hasil);
});
}
$(document).ajaxError(function(event, request, settings) {
// I believe in this area I should put my code to detect problem
});
</script>
<button onClick="Create_new_event();">Send</button>
看看這裏:http://stackoverflow.com/questions/1637019/how-to-get-the-jquery-ajax-error-response-text – Iansen
T an hans L ansen – Reinstar