求助為什么點擊沒反應(yīng)
?<script type="text/javascript">??
? ?function rec()
? ?{
? ? ? ?var website=confirm("是否打開www.immoc.com);
? ? ? ?if (thewebsite==ture),
? ? ? ?{
? ? ? ? ? ?window,open('www.immoc.com','_blank',width=400,height=500,top=no,toolbar=no);
? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{
? ? ? ? ? ? ? ?window,close();
? ? ? ? ? ?}
? ?};
? ??
? </script>?
2020-12-18
if (thewebsite==ture),?多了the和一個逗號,去掉,true不是ture。
?window,open 和?window,close() 中間是.點,不是逗號
width=400,height=500,top=no,toolbar=no? 這個參數(shù)字符串也需要加單引號
("是否打開www.immoc.com)缺一個結(jié)束的雙引號
修改完重新提交就好了?
2020-12-15
function?rec()
{
????var?website=confirm("是否打開www.immoc.com");
????if?(website==true)
????{
????????window.open("http://idcbgp.cn",'_blank','width=400,height=500,top=no,toolbar=no');
????}
????else
????{
????????window.close();
????}
}
</script>
</head>?
<body>?
????<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="rec()"?/>?
?</body>
</html>
應(yīng)該是標點符號不全,還有單詞打錯了:"true"不是"ture",var websit,下面是thewebsit
如果不跳轉(zhuǎn)就換到html編輯軟件中運行