Changeset 7992

Show
Ignore:
Timestamp:
04/07/07 16:44:56 (21 months ago)
Author:
alex
Message:

use a more accureate success tests. Also make semi-private to allow the xhr* functions to use it directly. Refs #2500

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/_loader/hostenv_browser.js

    r7989 r7992  
    100100                } 
    101101 
    102                 var isDocumentOk = function(http){ 
     102                d._isDocumentOk = function(http){ 
    103103                        var stat = http["status"]; 
    104                         // allow a 304 use cache, needed in konq (is this compliant with 
    105                         // the http spec?) 
    106                         return Boolean((!stat)||((200 <= stat)&&(300 > stat))||(stat==304)); 
     104                        return Boolean( ((stat>=200)&&(stat<300))||     // allow any 2XX response code 
     105                                (stat==304)||                                           // get it out of the cache 
     106                                (location.protocol=="file:" && (stat==0 || stat==undefined))|| 
     107                                (location.protocol=="chrome:" && (stat==0 || stat==undefined)) 
     108                        ); 
    107109                } 
    108110 
     
    122124                        try{ 
    123125                                http.send(null); 
    124                                 if(!isDocumentOk(http)){ 
     126                                if(!d._isDocumentOk(http)){ 
    125127                                        var err = Error("Unable to load "+uri+" status:"+ http.status); 
    126128                                        err.status = http.status;