我知道在 jQuery ajax 中有检测错误的工具,但我想要的是如何描述问题所在?404,没有互联网连接,内部服务器错误或其他什么?
这是我的简单程序
<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>