<!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?cof=confirm("是否打開此網(wǎng)頁?");
????????if(cof)
????????{???var?pro=prompt("確定打開的網(wǎng)址:","www.baidu.com/");
????????????window.open(pro,'_blank','height=500,width=400,menubar=no,toolbar=no');
????????}
????}
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
2016-06-05
域名不帶 http://?其實也是有問題的
2016-06-05
函數(shù)名不一樣。大小寫不分。。。。
2016-06-05
?if(cof)應(yīng)該改成if(cof==ture)沒有判斷,讓程序怎么執(zhí)行啊
2016-06-05
你的函數(shù)名openwindow的w是小寫,在input框中是大寫。不一樣,就不能調(diào)用函數(shù)了,仔細(xì)點呀
2016-06-05
{???var?pro=prompt("確定打開的網(wǎng)址:","www.baidu.com/");
????????????window.open(pro,'_blank','height=500,width=400,menubar=no,toolbar=no');
????????}
pro 是不是要改成網(wǎng)址