试图在 HTML 中打开一个新的 window 而 window.open 不起作用
trying to open a new window in HTML with window.open not working
我试图在按下按钮时打开一个新的 window,但我的代码无法正常工作。我在参数列表后收到错误“Uncaught SyntaxError: missing )”。我找不到我做错了什么
<HTML>
<body>
<button id="open_window" onclick="window.open(https://www.google.com, height=570, width=520);"></button>
<style>
#open_window{
position: fixed;
width: 15%;
height: 15%;
left: 35%;
top: 35%;
}
</style>
</body>
</HTML>
Url应该引用
<button id="open_window" onclick="window.open('https://www.google.com', height=570, width=520);"></button>
没关系,引用你的url
'https://www.google.com'
我试图在按下按钮时打开一个新的 window,但我的代码无法正常工作。我在参数列表后收到错误“Uncaught SyntaxError: missing )”。我找不到我做错了什么
<HTML>
<body>
<button id="open_window" onclick="window.open(https://www.google.com, height=570, width=520);"></button>
<style>
#open_window{
position: fixed;
width: 15%;
height: 15%;
left: 35%;
top: 35%;
}
</style>
</body>
</HTML>
Url应该引用
<button id="open_window" onclick="window.open('https://www.google.com', height=570, width=520);"></button>
没关系,引用你的url
'https://www.google.com'