正確答案啊啊啊啊啊啊
<script>
function openwindow(){
var dk = confirm("是否打開新的網頁?");
if(dk == true){
var url = prompt("請輸入網址","http://www.xianlaiwan.cn");
};
if(url != null){
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
};
};
</script>
2019-01-12
2019-01-12
? <script type="text/javascript">??
? ? function openWindow(){
? ? // 新窗口打開時彈出確認框,是否打開
? ? var open=confirm("dakai?");
? ? if(open){
? ? document.write("go on") ;? ?
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? var url=prompt("URL:","http://www.xianlaiwan.cn");
? ? document.write(url);
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? window.open(url,'_blank','width=400,heigh=500');
? ? }
? ? }
? </script>
2019-01-11
不好意思- -。慕課網打得開
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://www.xianlaiwan.cn/","_blank","width=400px,height=500px,menubar=no,toolbar=no");
? ? }
? ? var mywin=window.open("http://www.xianlaiwan.cn/","_blank","width=400px,height=500px,menubar=no,toolbar=no");
? ? else{
? ? ? ? mywin.close();
? ? }
? ? }
? ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? };
? ??
? </script>?
?</head>?
?<body>?
? <input name="name" type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
建議你把這段代碼復制到VScode。在慕課網也不知道怎么回事,我也打不開。