請問我的代碼哪里錯了
<!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 kai=confirm('是否打開網站');
?????? if kai==true
?????? {
?????????? var dingkai=prompt("默認網站為 http://www.xianlaiwan.cn/",'http://www.xianlaiwan.cn/');
??????????? if dingkai!=null
??????? {
??????????? window.open(dingkai,'width=400,height=500,menubar=no,toolbar=no');
??????? }
?????? }
?? ?
????? ?
??? // 新窗口打開時彈出確認框,是否打開
???? ?
???? ?
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2016-04-26
if語句if(){},還有就是關于什么時候用單引號什么時候用雙引號,雖然有時候沒有區別,但還是注意一下用法規范
2016-04-26
IF用法問題。。。
2016-04-26
if的用法是if(){}