2—7彈不出框啊
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? ? ?function gg(){
? ? ? var gg=confirm("新窗口打開時彈出確認框,是否打開");
? ? // 新窗口打開時彈出確認框,是否打開
? ? if (gg==true) {
? ? ? ? var g=prompt("請輸入網址:","http://www.xianlaiwan.cn");
? ? window.open("http://www.xianlaiwan.cn,_blank,width=400,height=500,menubar=no,toolbar=no,")?
? ? };
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? else
? ? ?{return null;}
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? };
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-04-07
? window.open('http://www.xianlaiwan.cn/','about_blank','width=400,height=500,toolbar=no,menubar=no')
引號的使用要注意
2016-04-08
<html>
?<head>
? <title> new document </title>?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>??
? <script type="text/javascript">?
???
?? function openWindow(){
?????? var xinxi=prompt("是否打開:","http://www.xianlaiwan.cn/");
?????? if(xinxi==ture)
??????
?????? {windows.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,took=lbar=no')
???????
?????? }
?????? else
?????? {return null;}
?????? }
??
???
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2016-04-07
哎呀。?onclick="openWindow()"忘記改了0-0