blob: 2090436aed4d4e4162faeaf64301d1510775858c [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html lang="en">
<head>
<title>setRequestHeader</title>
</head>
<body>
<p>Script did not run.</p>
<script type="text/javascript">
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var p = document.getElementsByTagName('p')[0];
p.firstChild.data = 'Test script started.';
window.onerror = function (error, file, line) { p.firstChild.data = 'ERROR: ' + error + ' (line ' + line + ')'; }
// window.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
var r = new XMLHttpRequest();
r.onreadystatechange = function () {
if (r.readyState == 4) {
p.firstChild.data = r.responseText;
if (window.testRunner)
testRunner.notifyDone();
} else
p.firstChild.data = 'Test in progress (' + r.readyState + '/4)';
};
r.open('GET', '001-test.cgi', true);
r.setRequestHeader('X-Test-Header', 'Test');
r.send(null);
p.firstChild.data = 'Request sent...';
</script>
</body>
</html>