mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[test] test case for ajax taken from w3schools
This commit is contained in:
parent
fb30cb3bf4
commit
924ffc6eae
23
test/ecmascript/ajax.html
Normal file
23
test/ecmascript/ajax.html
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="demo">
|
||||||
|
<h2>The XMLHttpRequest Object</h2>
|
||||||
|
<button type="button" onclick="loadDoc()">Change Content</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function loadDoc() {
|
||||||
|
const xhttp = new XMLHttpRequest();
|
||||||
|
xhttp.onload = function() {
|
||||||
|
document.getElementById("demo").innerHTML =
|
||||||
|
this.responseText;
|
||||||
|
}
|
||||||
|
xhttp.open("GET", "ajax_info.txt");
|
||||||
|
xhttp.send();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
4
test/ecmascript/ajax_info.txt
Normal file
4
test/ecmascript/ajax_info.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<h1>AJAX</h1>
|
||||||
|
<p>AJAX is not a programming language.</p>
|
||||||
|
<p>AJAX is a technique for accessing web servers from a web page.</p>
|
||||||
|
<p>AJAX stands for Asynchronous JavaScript And XML.</p>
|
Loading…
Reference in New Issue
Block a user