issue 77 Support long install URLs

This commit is contained in:
Jason Barnabe 2012-12-01 17:50:43 -06:00
parent 88c3eeaf20
commit 0236efa5e0

View File

@ -41,11 +41,18 @@ function getResource(url, callback) {
return; return;
} }
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && callback) { if (xhr.readyState == 4 && callback) {
callback(xhr.responseText); callback(xhr.responseText);
} }
} }
if (url.length > 2000) {
var parts = url.split("?");
xhr.open("POST", parts[0], true);
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhr.send(parts[1]);
} else {
xhr.open("GET", url, true);
xhr.send(); xhr.send();
}
} }