Updated files

This commit is contained in:
RobinNixon
2021-04-18 11:18:28 +01:00
parent aefe77f6e8
commit f63a81074d
187 changed files with 1694 additions and 254 deletions
+35
View File
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html> <!-- xmlget.html -->
<head>
<title>Asynchronous Communication Example</title>
</head>
<body>
<h1>Loading XML data into a DIV</h1>
<div id='info'>This sentence will be replaced</div>
<script>
let out = ''
let nocache = "&nocache=" + Math.random() * 1000000
let url = "rss.news.yahoo.com/rss/topstories"
let XHR = new XMLHttpRequest()
XHR.open("POST", "http://127.0.0.1/18/xmlget.php?url=" + url + nocache, true)
XHR.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
XHR.send()
XHR.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
let titles = this.responseXML.getElementsByTagName('title')
for (let j = 0 ; j < titles.length ; ++j)
{
out += titles[j].childNodes[0].nodeValue + '<br>'
}
document.getElementById('info').innerHTML = out
}
}
</script>
</body>
</html>