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