為什么我的實(shí)現(xiàn)不出來
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript"> ?
??? function rec(){
??????? var wopen = confirm("是否打開新窗口");
??????? if(wopen==true){
??????????? var nwindow=prompt("是否打開新網(wǎng)頁","http://idcbgp.cn");
??????????? if(nwindow!=null){
??????????????? window.open('http://idcbgp.cn','-blank','width=400px,height=500px,menubar=no,toolbar=no')
??????????? }
??????????? else{
??????????????? null
??????????? }
??????? }
??????? }
??????? else{
??????????? null
??????? }
?????? ?
??? }
?? ?
??? // 新窗口打開時彈出確認(rèn)框,是否打開
??? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網(wǎng)站" onclick="rec()" />
?</body>
</html>
2019-01-02
window.open('http://idcbgp.cn','-blank','width=400px,height=500px,menubar=no,toolbar=no')
自己看下哪里錯了
2019-01-06
首先,-blacnk需改成_blank;其次,第一個else 后面多了一個}