about summary refs log tree commit diff stats
path: root/test/net/xhr.html
blob: 2d0347729288d242ad6dc9a8e5ff805c1fd30be3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<title>onclick setter/getter</title>
<div id=x>Fail</div>
<script src=asserts.js></script>
<script>
const x = new XMLHttpRequest();
assert(x.onreadystatechange === null);
function myFunction() {
	;
}
x.onreadystatechange = myFunction;
assert(myFunction === x.onreadystatechange);
assert(x.readyState === XMLHttpRequest.UNSENT);
x.open("GET", "ping", false);
assert_throws("x.responseType = 'document'");
x.send();
assert_equals(x.readyState, XMLHttpRequest.DONE);
assert_equals(x.responseText.trim(), "pong");
document.getElementById("x").textContent = "Success";
</script>