aboutsummaryrefslogtreecommitdiffstats
path: root/src/Browser.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Browser.js')
-rw-r--r--src/Browser.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Browser.js b/src/Browser.js
index d2e8608d..2a90b63f 100644
--- a/src/Browser.js
+++ b/src/Browser.js
@@ -8,6 +8,7 @@ function Browser(location, document) {
this.expectedUrl = location.href;
this.urlListeners = [];
this.hoverListener = noop;
+ this.isMock = false;
this.XHR = window.XMLHttpRequest || function () {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
@@ -53,6 +54,10 @@ Browser.prototype = {
},
xhr: function(method, url, post, callback){
+ if (isFunction(post)) {
+ callback = post;
+ post = null;
+ }
var xhr = new this.XHR();
xhr.open(method, url, true);
xhr.onreadystatechange = function() {
@@ -60,7 +65,7 @@ Browser.prototype = {
callback(xhr.status || 200, xhr.responseText);
}
};
- xhr.send('');
+ xhr.send(post || '');
},
watchUrl: function(fn){