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