cef/tests/cefclient/res/xmlhttprequest.html

20 lines
564 B
HTML
Raw Normal View History

<html>
<body>
<script language="JavaScript">
function execXMLHttpRequest()
{
xhr = new XMLHttpRequest();
xhr.open("GET",document.getElementById("url").value,false);
xhr.setRequestHeader('My-Custom-Header', 'Some Value');
xhr.send();
document.getElementById('ta').value = "Request\n\n"+xhr.responseText;
}
</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>