The documentation is here: http://docs.jquery.com/Ajax/jQuery.ajax
But, to summarize, the ajax call takes a bunch of options. the ones you are looking for are error and success.
You would call it like this:
$.ajax({
url: 'mypage.html',
success: function(){
alert('success');
},
error: function(){
alert('failure');
}
});
I have shown the success and error function taking no arguments, but they can receive arguments.
The error function can take three arguments: XMLHttpRequest, textStatus, and errorThrown.
The success function can take two arguments: data and textStatus. The page you requested will be in the data argument.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…