<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>???
??<script?type="text/javascript">??
????function?a1(){
????????var?a1=confirm("是否打開?");
????????if(a1==true){
????????????var?b1=prompt("打開默認(rèn)","http//baidu.com");
????????}
????????else{
????????????return
????????}
????????if(b1?!=null){
????????????window.open(b1,"_blank","menubar=no","toolbar=no");
????????}
????????else{
????????????return
????????}
????}????
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
2015-07-27
第一:第10行,逗號(hào)應(yīng)該為英文逗號(hào)
第二:25行onclick調(diào)用的是openWindow()函數(shù),而你定義的是a1()函數(shù),兩者不對(duì)應(yīng),,所以應(yīng)該把7行的a1改為openWindow,或者把25行的openWindow改為a1