拓展一下,打开你想输入的任意网址,仅供参考:
<!DOCTYPE html>
<html>
<head>
<title>new document</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
<script type="text/javascript">
function openWindow() {
var message = confirm("是否要打开新网站?");
if (message == true) {
var address = prompt("请输入网址");
if (address) {
window.open("http://"+address, "_blank","width=400,height=500,menubar=no,toolbar=no");
}
} else {
alert("已取消");
}
}
</script>
</body>
</html>