代码把te2.html放到tomcat里,网络访问一下试试:
访问地址:http://localhost:8080/testjs/te2.html?ku=yourname&ka=yourage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" content="免费">
<!-- <meta http-equiv="refresh" content="3"> -->
<title>打开</title>
</head>
<body>
<h3 id="idShow">显示</h3>
<p id="idContent">内容</p>
<script type="text/javascript">
function popAlert() {
let x;
let r = window.confirm("你好啊,测试确定");
if (r === true) {
x = "按下了\n确定按钮";
} else {
x = "按下了\n取消按钮";
}
document.getElementById("idShow").innerHTML = x;
}
// popAlert();
let buffer = [];
buffer.push("href = ".concat(window.location.href).concat("<br>"));
buffer.push("status = ".concat(window.status).concat("<br>"));
buffer.push("closed = ".concat(window.closed).concat("<br>"));
buffer.push("name = ".concat(window.name).concat("<br>"));
buffer.push("location.host = ".concat(window.location.host).concat("<br>"));
buffer.push("location.hostname = ".concat(window.location.hostname).concat("<br>"));
buffer.push("location.pathname = ".concat(window.location.pathname).concat("<br>"));
buffer.push("location.port = ".concat(window.location.port).concat("<br>"));
buffer.push("location.protocal = ".concat(window.location.protocal).concat("<br>"));
buffer.push("location.search = ".concat(window.location.search).concat("<br>"));
buf