Skip to content

Commit

Permalink
adding localXHR.js which makes Request compatible with the file:// pr…
Browse files Browse the repository at this point in the history
…otocol
  • Loading branch information
kassens committed Aug 23, 2008
1 parent 7406887 commit c523a7f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions localXHR.js
@@ -0,0 +1,13 @@
// makes Request compatible with requests on the file:// protocol

if (location.protocol == 'file:') Request.implement({

setTransport: function(){
this.transport = (window.ActiveXObject) ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
},

isSuccess: function() {
return (!this.status || (this.status >= 200) && (this.status < 300));
}

});

0 comments on commit c523a7f

Please sign in to comment.