don't halt the page load while waiting for this

This commit is contained in:
Shish 2010-01-03 09:51:06 +00:00
parent ed4b62dc71
commit 15f78d9883

View file

@ -228,18 +228,20 @@ class Setup extends SimpleExtension {
checkbox.disabled = true;
out_span.innerHTML = '(testing...)';
http_request = getHTTPObject();
http_request.open('GET', '$test_url', false);
http_request.send(null);
$(document).ready(function() {
http_request = getHTTPObject();
http_request.open('GET', '$test_url', false);
http_request.send(null);
if(http_request.status == 200 && http_request.responseText == 'ok') {
checkbox.disabled = false;
out_span.innerHTML = '(tested ok)';
}
else {
checkbox.disabled = true;
out_span.innerHTML = '(test failed)';
}
if(http_request.status == 200 && http_request.responseText == 'ok') {
checkbox.disabled = false;
out_span.innerHTML = '(tested ok)';
}
else {
checkbox.disabled = true;
out_span.innerHTML = '(test failed)';
}
});
</script>";
$sb = new SetupBlock("General");
$sb->position = 0;