點擊按鈕沒有打開新窗口
請幫我看看哪里出問題?
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>window對象</title> <script?type="text/javascript"> alert("歡迎來到慕課網"); function?open(){ ????window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400'); } </script> </head> <body> <form> <input?type="button"?value="點擊我,打開新窗口"??onclick="open()"?/> </form> </body> </html>
2017-08-18
open是window的方法,再定義就沖突了,可以換個函數名
2017-08-17
open是關鍵保留字嗎?換了函數名就解決了