diff options
Diffstat (limited to 'chrome/test/data/sync_xmlhttprequest.html')
-rw-r--r-- | chrome/test/data/sync_xmlhttprequest.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/test/data/sync_xmlhttprequest.html b/chrome/test/data/sync_xmlhttprequest.html new file mode 100644 index 0000000..cf3e8d6 --- /dev/null +++ b/chrome/test/data/sync_xmlhttprequest.html @@ -0,0 +1,32 @@ +<html> +<head> +<script> +var request_success = false; + +function OnLoad() { + var request = new XMLHttpRequest(); + request.open("GET", "title1.html", false); + request.send(""); + + var my_div = document.getElementById("my_div"); + if (request.readyState == 4 && request.status == 200) { + request_success = true; + my_div.innerHTML = "Got a successful response: " + request.responseText; + } else { + my_div.innerHTML = "Request failed: ready state=" + request.readyState + + " status=" + request.status; + } +} + +function DidSyncRequestSucceed() { + return request_success; +} + +</script> +</head> +<body onload="OnLoad();"> +This page sends a synchronous XMLHttpRequest. +<br><br> +<div id="my_div"></div> +</body> +</html> |