正確答案啊啊啊啊啊啊
<script>
function openwindow(){
var dk = confirm("是否打開(kāi)新的網(wǎng)頁(yè)?");
if(dk == true){
var url = prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn");
};
if(url != null){
window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
};
};
</script>
2019-01-12
2019-01-12
? <script type="text/javascript">??
? ? function openWindow(){
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? var open=confirm("dakai?");
? ? if(open){
? ? document.write("go on") ;? ?
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? var url=prompt("URL:","http://idcbgp.cn");
? ? document.write(url);
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? window.open(url,'_blank','width=400,heigh=500');
? ? }
? ? }
? </script>
2019-01-11
不好意思- -。慕課網(wǎng)打得開(kāi)
2019-01-11
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html"/>? ?
? <script type="text/javascript">??
? ? function openWindow()
? ? {
? ? var operation=confirm("other wd");
? ? if(operation==true)
? ? {
? ? window.open("http://idcbgp.cn/","_blank","width=400px,height=500px,menubar=no,toolbar=no");
? ? }
? ? var mywin=window.open("http://idcbgp.cn/","_blank","width=400px,height=500px,menubar=no,toolbar=no");
? ? else{
? ? ? ? mywin.close();
? ? }
? ? }
? ??
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? };
? ??
? </script>?
?</head>?
?<body>?
? <input name="name" type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
建議你把這段代碼復(fù)制到VScode。在慕課網(wǎng)也不知道怎么回事,我也打不開(kāi)。