不知道為什么點擊了彈出窗口的“好”,但是沒有做我的window.open代碼
<!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 isOpen = confirm("是否打開 http://www.xianlaiwan.cn/");
? ? ? ? if(isOpen == ture){
? ? ? ? ? ? window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? }else{
? ? ? ? ? ??
? ? ? ? }
? ? }
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2022-03-24
你看看判斷狀態,改變狀態的地方是不是有什么問題嘞。backgroundColor是明確指出是背景色,background是指背景
2018-09-29
還有那個網址您最好再確認一下,是不是對的,因為我感覺你那段冒號的空格有一點大,可能是網址的原因。
2018-09-29
你好,要么把else給刪除掉,要么把else后面寫完整。