mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-08 07:41:04 +01:00
0255e4c741
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2011 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
27 lines
749 B
HTML
27 lines
749 B
HTML
<html>
|
|
<body bgcolor="white">
|
|
<script language="JavaScript">
|
|
function execXMLHttpRequest()
|
|
{
|
|
xhr = new XMLHttpRequest();
|
|
xhr.open("GET", document.getElementById("url").value, true);
|
|
xhr.setRequestHeader('My-Custom-Header', 'Some Value');
|
|
xhr.onload = function(e) {
|
|
if (xhr.readyState === 4) {
|
|
var value = "Status Code: "+xhr.status;
|
|
if (xhr.status === 200)
|
|
value += "\n\n"+xhr.responseText;
|
|
document.getElementById('ta').value = value;
|
|
}
|
|
}
|
|
xhr.send();
|
|
}
|
|
</script>
|
|
<form>
|
|
URL: <input type="text" id="url" value="http://tests/request">
|
|
<br/><input type="button" onclick="execXMLHttpRequest();" value="Execute XMLHttpRequest">
|
|
<br/><textarea rows="10" cols="40" id="ta"></textarea>
|
|
</form>
|
|
</body>
|
|
</html>
|