為什么只能打開慕客網(wǎng),輸入其他的網(wǎng)址沒有用
<!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 popup1=confirm("是否確認(rèn)打開?")
? ? ? ? if(popup1==true){
? ? ? ? ? ? var popup2=prompt("輸入您要進(jìn)入的網(wǎng)站:","http://idcbgp.cn");
? ? ? ? ? ? if(popup2!=null){
? ? ? ? ? ? ? ? window.open(popup2,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }else{alert("再見2");}
? ? ? ? }else{alert("再見1");}
? ? ? ? }
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-07-04
2016-07-04
http://要用英文的,慕課左邊給的那個(gè)是中文的,我當(dāng)時(shí)直接復(fù)制來用了,也把我坑了
2016-07-04
你的http處輸入錯(cuò)誤了,要全英文狀態(tài)下,應(yīng)該是http://idcbgp.cn