window.open()本地不能成功使用
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>學習JS測試</title>
<script type="text/javascript">
? ? ? ? ?function wopen(){
? ? ? ? ? window.open('http:www.xianlaiwan.cn' '_blank' 'width=600px,height=400px,top=100px,left=0')
? ? ? ? ?}
</script>
</head>
<body>
<input name="button" type="button" onClick="wopen()" value="測試">
</body>
</html>
2016-07-21
window.open函數的三個參數之間要使用英文逗號隔開
2016-07-21
window.open('http:www.xianlaiwan.cn' '_blank' 'width=600px,height=400px,top=100px,left=0')
這里寫錯了,沒用逗號隔開。。
window.open("http://www.xianlaiwan.cn","_blank()","width=600px,height=400px,top=100px,left=0");
2016-07-21
??function wopen(){
? ? ? ? ? window.open('http://www.xianlaiwan.cn' ,'_blank' ,'width=600px,height=400px,top=100px,left=0')
? ? ? ? ?}
wopen(); //最后還要調用一下,然后就可以了,這是正確版本,首先你網址少兩斜杠,其次逗號沒分開,最后再調用一下函數,就可以了
2016-07-21
?function Wopen(){
? window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,top=100,left=0') ? ?
? }?
中間加逗號,望采納
2016-07-21
樓上說得對,還有網址打錯了,應該是http://www.xianlaiwan.cn吧