<!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 chuang=confirm("您要打開一個新的窗口嗎?");? ? ? ? // 新窗口打開時彈出確認框,是否打開? ? ? ? var website;? ? ? ??? ? ? ? if(chuang==true)? ? ? ? { website=prompt("請確認要訪問的網址并確認"?? ? ? ? ?,"http://www.xianlaiwan.cn" );? ? ??? ? ? ? }? ? ? ? ?else{}? ? ? ? if(website!=null)? ? ? ? {? ? ? ? window.open("website","_blank","width=100? ? ? ? ,height=500,menubar=no,toolbar=no")? ? ? ? }? ??? ? ? ?? ??? } ? ?? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網站" onclick="openWindow()" />??</body></html>
學習JAVAscript 遇到的問題 2-7編程練習
杰猛人
2015-04-18 17:46:18