請問哪里不對了???執(zhí)行不出來
<!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 ask=confirm("開不開");
? ? ? ? if(ask=true)
? ? ? ? {var fuck=prompt ("請輸入","idcbgp.cn");?
? ? ? ? if(fuck=true)
? ? ? ??
? ? ? ? {
? ? ? ? ? ? window.open('idcbgp.cn','_blank','width=400,height=500'); ??
? ? ? ? }
? ? ? ? else
? ? ? ? {alert("傾訴如");
? ? ? ? }
? ? ? ? }
? ? ? ? else
? ? ? ? {null;}
? ? ? ? }
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-06-24
prompt ?返回的內(nèi)容是你文本框輸入的內(nèi)容 不是true好false ? 并且判斷是否相等應該是雙等于號
function openWindow(){
? ? ? ? var ifopen = confirm("是否打開新的窗口");
? ? ? ? if(ifopen){
? ? ? ? window.open(prompt("請輸入打開的網(wǎng)址:","http://idcbgp.cn/code/1642"),"_blank","width = 400,height = 500,menubar = no,toolbar = no");
? ? ? ? }
? ? }
2016-06-24
ask==true
fuck=="idcbgp.cn"
2016-06-24
ask=true雙等號,一個等號表示賦值