我這個代碼哪里有問題,大家幫忙看一下
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
? function Wopen(){
? ? ? window.open('www.xianlaiwan.cn','_blank','height=600,width=400,top=100,left=0' );
? ? ? ??
? }?
</script>
</head>
<body>
? ? <input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >
</body>
</html>
2018-02-03
?地址少些了“http://”,?另外<input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >,input不需要關閉標簽,應該刪除掉“/”
2017-10-15
你的URL寫錯了呢。
2017-10-13
我試了一下,'http://www.xianlaiwan.cn/',改成這個新窗口就可以顯示頁面了
2017-10-07
其實我也不太確定:
這個onclick 中的 C 好像不能大寫吧
函數放的位置,可以換到</body>之前,不放在頭部里,試一下,我怕放在頭部里會“提前加載”,導致失效,這只是一種猜測,忙著刷題,有興趣就試一下吧!
2017-10-07
function Wopen(){
? ? ? window.open('www.xianlaiwan.cn','_blank=yes','height=600px,width=400px,top=100px,left=0px' );
? ? ? ??
? }?