From eb536ae20a7a00cb5283367dbdb957386ac21537 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sat, 15 Nov 2014 17:30:02 -0800 Subject: [PATCH] Change XMLHttpRequest call ordering to satisfy firefox. --- static/cosmopolite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/cosmopolite.js b/static/cosmopolite.js index b0483cb..2517598 100644 --- a/static/cosmopolite.js +++ b/static/cosmopolite.js @@ -929,7 +929,6 @@ Cosmopolite.prototype.sendRPCs_ = function(commands, opt_delay) { } var xhr = new XMLHttpRequest(); - xhr.responseType = 'json'; var retryAfterDelay = (function(newCommands) { // Exponential backoff + random stagger values @@ -957,6 +956,7 @@ Cosmopolite.prototype.sendRPCs_ = function(commands, opt_delay) { 'load', this.onRPCResponse_.bind(this, xhr, retryAfterDelay, commands)); xhr.addEventListener('error', retryAfterDelay.bind(null, commands)); xhr.open('POST', this.urlPrefix_ + '/api'); + xhr.responseType = 'json'; xhr.send(JSON.stringify(request)); };