2011-01-12 00:46:14 +01:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script language="JavaScript">
|
|
|
|
function execXMLHttpRequest()
|
|
|
|
{
|
|
|
|
xhr = new XMLHttpRequest();
|
2011-03-04 18:56:01 +01:00
|
|
|
xhr.open("GET",document.getElementById("url").value,false);
|
2011-01-12 00:46:14 +01:00
|
|
|
xhr.setRequestHeader('My-Custom-Header', 'Some Value');
|
|
|
|
xhr.send();
|
|
|
|
document.getElementById('ta').value = "Request\n\n"+xhr.responseText;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<form>
|
2011-03-04 18:56:01 +01:00
|
|
|
URL: <input type="text" id="url" value="http://tests/request">
|
|
|
|
<br/><input type="button" onclick="execXMLHttpRequest();" value="Execute XMLHttpRequest">
|
2011-01-12 00:46:14 +01:00
|
|
|
<br/><textarea rows="10" cols="40" id="ta"></textarea>
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|