blob: 3356e010514c79888cfd44d9eeb8291832fd7804 [file] [log] [blame]
Philip Jägenstedtc053f402014-01-22 17:02:181<!DOCTYPE html>
2<html>
3<head>
4 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#handler-xhr-onload" data-tested-assertations="../.." />
5 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#event-xhr-load" data-tested-assertations="../.." />
6 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#infrastructure-for-the-send()-method" data-tested-assertations="following::dt[11] following::a[contains(@href,'#switch-done')]/.." />
7 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#switch-done" data-tested-assertations="following::ol/li[1] following::ol/li[6]" />
8 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-response-attribute" data-tested-assertations="/following::ol/li[3]" />
9 <script src="/resources/testharness.js"></script>
10 <title>XMLHttpRequest: The send() method: Fire an event named load (no response entity body and the synchronous flag is set)</title>
11</head>
12
13<body>
14 <div id="log"></div>
15
16 <script type="text/javascript">
17 test(function()
18 {
19 var xhr = new XMLHttpRequest();
20 var pass = false;
21
22 xhr.onload = function(e)
23 {
24 assert_true(e instanceof ProgressEvent);
25 assert_equals(e.type, "load");
26 pass = true;
27 };
28
29 xhr.open("POST", "./resources/content.py", false);
30 xhr.send();
31
32 assert_equals(xhr.response, "");
33 assert_true(pass);
34 });
35 </script>
36</body>
37</html>