<!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?open=confirm("是否打開");
???
?????if(open==true)
???????{
???????var?ope=prompt("shuru","http://idcbgp.cn/");}
??????
????????if(ope!=null){
????window.open("ope",'width=400','height=500''_blank','menubar=no','toolbar=no')};
????
????????else{
?????????window.open('?ope','width=400','height=500''_blank','menubar=no','toolbar=no')};
????else
???{?alert("bye");}
???
???}
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
2015-08-02
花括號嵌套錯(cuò)亂了。
這里變量ope是不需要加引號的。后面的參數(shù)直接用一對單引號就可以了。
修改后的代碼你看看