<html> | |
<body> | |
<pre id='console'></pre> | |
<script type="text/javascript"> | |
function log(message) | |
{ | |
document.getElementById('console').appendChild(document.createTextNode(message + "\n")); | |
} | |
if (window.testRunner) { | |
testRunner.dumpAsText(); | |
testRunner.waitUntilDone(); | |
} | |
function processStateChange() | |
{ | |
if (xhr.readyState == xhr.DONE) { | |
log(xhr.responseText); | |
if (window.testRunner) | |
testRunner.notifyDone(); | |
} | |
} | |
function errorHandler() | |
{ | |
log("FAIL: Network error."); | |
if (window.testRunner) | |
testRunner.notifyDone(); | |
} | |
var xhr = new XMLHttpRequest; | |
xhr.onreadystatechange = processStateChange; | |
xhr.onerror = errorHandler; | |
xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi", true); | |
xhr.send(); | |
</script> | |
</body> | |
</html> |