求問為什么無法運行??
<html>
<head>
?<title> new document </title> ?
?<meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ?
?<script type="text/javascript"> ?
function openWindow(){
? ?var open=confirm("確認(rèn)新建窗口打開網(wǎng)站嗎?");
? ?if(open==true){
? ? ? ?var url=prompt("通過輸入對話框,確定打開的網(wǎng)址","http://idcbgp.cn");
? ? ? ?if(url!=null){
? ? ? ? ? ?window.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no'); ? ?
? ? ? ?}else{
? ? ? ? ? ?alert("再見!");
? ? ? ? ? ?}
? ?}else{
? ? ? ?alert("再見!");
? ? ? ?}
? ?}
? ?
? ?
?</script>
</head>
<body>
? ? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
</html>
2016-10-28
可以打開呀
2016-10-25
我試一下,在文本(html文件)是打不開的,但在慕課網(wǎng)上的練習(xí)中可以打開,應(yīng)該是沒有安裝Javaweb的程序或是360網(wǎng)頁不兼容
2016-10-25
您的代碼在編譯器中可以運行效果如下圖:
是在mooc網(wǎng)上沒有通過吧,將縮進規(guī)范下,再試一下可不可以通過。