<!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 mymessage=confirm("是否打開新窗口?")? ??? ? ? ? if(mymessage==true)? ? ? ? {? ? ? ? ? ? var url=prompt("請(qǐng)輸入網(wǎng)址:","http://yifanck.cn")? ? ? ? ? ??? ? ? ? ? ? if(url!=null)? ? ? ? ? ? {? ? ? ? ? ? ? ?window.open('http://yifanck.cn','_blank','width=400,height=500,menumber=no,toolbar=no')?? ? ? ? ? ? }? ? ? ? ? ? else? ? ? ? ? ? {? ? ? ? ? ? ? ? window.close()? ? ? ? ? ? }? ? ? ? }? ? ? ? else? ? ? ? {? ? ? ? ? ? document.write("打開失??!")? ? ? ? }? ? }? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開? ? // 通過(guò)輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://yifanck.cn/? ? //打開的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。? ??? ??? </script>??</head>??<body>?? ? ? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
請(qǐng)大家?guī)兔匆幌逻@段代碼哪里有誤了,為什么點(diǎn)擊按鈕的時(shí)候沒有彈出窗口?
婷婷很陽(yáng)光
2016-04-11 21:56:01