這是我的代碼,問(wèn)題出在哪兒了?
<!DOCTYPE?html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ??
? <script type="text/javascript"> ?
? ? function openWindow(){
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? var a = confirm("確定打開(kāi)http://yifanck.cn?");
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
? ? if(a == true){
? ? ? ? window.open('http://yifanck.cn','_blank','width=400px,hight=500px,menubar=no,toolbar=no');
? ? }else{
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-05-29
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ??
? <script type="text/javascript"> ?
? ? function openWindow(){
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? var a = confirm("確定打開(kāi)http://yifanck.cn?");
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
? ? if(a == true){
? ? ? ? window.open('http://yifanck.cn','_blank','width=400px,hight=500px,menubar=no,toolbar=no');
? ? }else{
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? }
}//你少了這一行
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-05-29
?if(a == true){
? ? ? ? window.open(
2018-05-29
,'width=400px,hight=500px,menubar=no,toolbar=no');