求師兄,師姐們幫忙看看,這樣寫怎么運行不了呢?
<!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 abbbb=confirm("是否打開這個網(wǎng)站?")
? ??
? ? var abcd=prompt("請輸入網(wǎng)址","http://idcbgp.cn/")
? ? if(abbbb==true&&abcd="http://idcbgp.cn/")
? ? {window.open("http://idcbgp.cn/",width="400",height="500",menubar="no",toolbar="no")
}
else
{alert("請再次輸入!")
}
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-03-02
我敲的,借鑒借鑒
2017-03-02
function openWindow(){
? ? ? ? ?var num=confirm('確定打開嗎?');
? ? ? ? ?if(num){
? ? ? ? ? ? ?var sco=prompt('請輸入網(wǎng)址:','http://idcbgp.cn/')
? ? ? ? ? ? ?window.open('sco','','width=400,height=500,menubar=0,toolbar=0');
? ? ? ? ?}?
? ? ?}
2017-03-01
你同時讓瀏覽器輸出兩個對話窗口,她會執(zhí)行不過來的,需要彈出一個窗口,給一個返回值,然后她才能判斷,再彈出窗口的
2017-02-25
函數(shù)名window的W是大寫的
2017-02-25
prompt第二個參數(shù)放一個變量,然后直接把其作為open的第一個參數(shù)