xmlhttprequest - jquery xhr success and error states -
what xhr states jquery accepts success states? error states? know 200 success state , 401 error state. further information on helpful. can please point me read. not information jquery api.
when can't find answer in the docs, dive the source. here's bit you're looking for, line 2:
// if successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // set if-modified-since and/or if-none-match header, if in ifmodified mode. if ( s.ifmodified ) { if ( ( lastmodified = jqxhr.getresponseheader( "last-modified" ) ) ) { jquery.lastmodified[ ifmodifiedkey ] = lastmodified; } if ( ( etag = jqxhr.getresponseheader( "etag" ) ) ) { jquery.etag[ ifmodifiedkey ] = etag; } } // if not modified if ( status === 304 ) { statustext = "notmodified"; issuccess = true; // if have data } else { try { success = ajaxconvert( s, response ); statustext = "success"; issuccess = true; } catch(e) { // have parsererror statustext = "parsererror"; error = e; } } } else { // extract error statustext // normalize statustext , status non-aborts error = statustext; if( !statustext || status ) { statustext = "error"; if ( status < 0 ) { status = 0; } } }
Comments
Post a Comment