<!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 mess=confirm("是否打開網(wǎng)頁(yè)");? ? ? ? ? ? ? if(mess==true)? ? ? ? ? ? ? {? ? ? ? ? ? ? ? prompt("輸入網(wǎng)站","http://idcbgp.cn");? ? ? ? ? ? ? }? ? ? ? ? ? ? var openshit=prompt? ? ? ? ? ? ? ? if(openshit!=null)? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? window.open('openshit','height=500,width=400,menubar=no,toolbar=no')? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? else? ? ? ? ? ? ? ? {alert("badnews")}? ? ? ? ? ? ? else{alert("badnews")? ? ? ? ? ? ? }? ??? ??? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
第二章最后的練習(xí)題卡住了,不知道代碼哪里有問題,希望大家指正
leonailele
2016-11-04 05:27:14