Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Fix AJAX in IE6/7
Browse files Browse the repository at this point in the history
  • Loading branch information
ebryn authored and wagenet committed Jun 29, 2011
1 parent 8418816 commit 83760c2
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/spade.js
Expand Up @@ -500,8 +500,13 @@ var spade ;
};

Sp.runCommand = function(command, args, callerId, pkg){
var xhr = new XMLHttpRequest(),
url = "_spade/command",
var xhr;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else { // IE
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "_spade/command",
params = [];

args.command = command;
Expand Down Expand Up @@ -565,7 +570,12 @@ var spade ;
function syncLoad(spade, id, url, format, force) {
if (force) { url = url+'?'+(+ new Date()); }

var xhr = new XMLHttpRequest();
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else { // IE
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}

xhr.open('GET', url, false);
try {
xhr.send(null);
Expand Down

0 comments on commit 83760c2

Please sign in to comment.