分类:
2008-10-16 19:25:53
this.status = function(_status) { var s = _status.toString().split(""); switch(s[0]) { case "1": return this.getInformationalStatus(_status); break; case "2": return this.getSuccessfulStatus(_status); break; case "3": return this.getRedirectionStatus(_status); break; case "4": return this.getClientErrorStatus(_status); break; case "5": return this.getServerErrorStatus(_status); break; } } |
if(ajax.checkReadyState('body', 'loading...', 'loading...', 'loading...') == "OK") { document.getElementById('body').innerHTML = ajax.request.responseText; } |
{ 'header' : 'How to Handle the Ajax Response', 'description' : 'An in-depth explanation of how to handle the Ajax response.', 'sourceUrl' : ''} |
if(ajax.checkReadyState('body', 'loading...', 'loading...', 'loading...') == "OK") { eval("var response = ("+ajax.request.responseText+")"); document.getElementById('body').innerHTML = "" + response.header + " " + response.description + " " + "Download the source files"; } |
var response = ajax.request.responseXML.documentElement; |
var header = response.getElementsByTagName('header')[0].firstChild.data; var description = response.getElementsByTagName('description')[0].firstChild.data; var sourceUrl = response.getElementsByTagName('sourceUrl')[0].firstChild.data; |
document.getElementById('body').innerHTML = "" + header + " " + description + " " + "Download the source files"; |