4 var request_success
= false;
7 var request
= new XMLHttpRequest();
8 request
.open("GET", "title1.html", false);
11 var my_div
= document
.getElementById("my_div");
12 if (request
.readyState
== 4 && request
.status
== 200) {
13 request_success
= true;
14 my_div
.innerHTML
= "Got a successful response: " + request
.responseText
;
16 my_div
.innerHTML
= "Request failed: ready state=" + request
.readyState
+
17 " status=" + request
.status
;
21 function DidSyncRequestSucceed() {
22 return request_success
;
27 <body onload=
"OnLoad();">
28 This page sends a synchronous XMLHttpRequest.
30 <div id=
"my_div"></div>