blob: 69ad6193d8e01469afe17a366b0e41fd0b142b8f [file] [log] [blame]
Hallvord Reiar M. Steenddb103f2013-04-26 12:24:261<!DOCTYPE html>
2<html>
3 <head>
4 <title>XMLHttpRequest: open() resolving URLs - insert &lt;base></title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
Ms2ger91fef142014-11-01 09:24:377 <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol/li[2]/ol/li[2] following::ol/li[7] following::ol/li[14]/ul/li[2]" />
8 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetext-attribute" data-tested-assertations="following::ol/li[4]" />
Hallvord Reiar M. Steenddb103f2013-04-26 12:24:269 </head>
10 <body>
11 <div id="log"></div>
12 <script>
13 test(function() {
14 var client = new XMLHttpRequest(),
15 base = document.createElement("base")
16 base.href = location.href.replace(/\/[^/]*$/, '') + "/resources/"
17 document.getElementsByTagName("head")[0].appendChild(base)
18 client.open("GET", "folder.txt", false)
19 client.send(null)
20 assert_equals(client.responseText, "bottom\n")
21 })
22 </script>
23 </body>
24</html>