程序在這兒~
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function openWindow(){
? ? // 新窗口打開時彈出確認框,是否打開
? ? var taylor=confirm("確定打開窗口?");
? ? // 通過輸入對話框,確定打開的網址,默認為 http://idcbgp.cn/
? ? if(taylor==true){
? ? ? ? var swift=prompt("請輸入網址:","http://idcbgp.cn");
? ? ? ? if(swift!=null){
? ? ? ? ? ? window.open(swift,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? }else{
? ? ? ? ? ? alert("see you next time!");
? ? ? ? }
? ??
? ? }else{
? ? ? ? alert("ahaha");
? ? }
? ? }
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-03-29
2016-03-29
同上............
2016-03-29
30秒
2016-03-29
var swift=prompt("請輸入網址:","http://idcbgp.cn");
這一行參數(shù)間的逗號是中文字符,找了好久才發(fā)現(xiàn)。。。。