用VS和慕課自帶的IDE出現不同結果
<!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 judge = confirm("你是否要打開本網站?");
? ? ? ? if(judge==true)
? ? ? ? {
? ? ? ? ? ? window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? var abc =prompt("請輸入你想訪問的鏈接:");
? ? ? ? ? ? window.open(abc);
? ? ? ? }
}
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
這個代碼在慕課網上面輸入是可以運行的,但是在vs2017上面輸入同樣的代碼,保存為HTML文件,則會出現這個現象
2018-11-20
這么看著,估計是文件地址寫錯了……