如何自动启动a href=";javascript:void window.open(打开加载)
如何在HTML中将其自动启动为“onload”?我研究的其他内容不起作用。我只希望我的网站在新窗口中打开,并且必须使用blogspot。将其放在脚本块中,而不是a标签中如何自动启动a href=";javascript:void window.open(打开加载),javascript,html,Javascript,Html,如何在HTML中将其自动启动为“onload”?我研究的其他内容不起作用。我只希望我的网站在新窗口中打开,并且必须使用blogspot。将其放在脚本块中,而不是a标签中 <a href="javascript:void window.open('website', 'pukarock', 'width=1018, height=715, scrollbars=yes, resizable=yes');">click me</a> window.open('websit
<a href="javascript:void window.open('website', 'pukarock', 'width=1018, height=715, scrollbars=yes, resizable=yes');">click me</a>
window.open('website','pukarock','width=1018,height=715,scrollbars=yes,resizable=yes')
不要使用href=“javascript:void”
这意味着没有javascript的用户无法使用该链接。请改用类似的方式
<script type='text/javascript'>
window.open('website', 'pukarock', 'width=1018, height=715, scrollbars=yes, resizable=yes')
</script>
然后将其添加到页面的页眉
<a href="http://www.mysite.com/" onclick="openNewWindow(this.href); return false;">Click</a>
函数openNewWindow(url){
打开(url,'pukarock','width=1018,height=715,scrollbars=yes,resizeable=yes')
}
如果要在加载内容后打开页面,请使用以下命令:
<script>
function openNewWindow(url) {
window.open(url, 'pukarock', 'width=1018, height=715, scrollbars=yes, resizable=yes')
}
</script>
ahhh!弹出窗口!我的浏览器在摇晃,我们说话的时候它向你挥拳
<!--use some standards of html-–>
<html>
<head>
</head>
<body onload="openSite();">
<script type='text/javascript'>
function openSite()
{
window.open('website','pukarock','width=1018,height=715,scrollbars=yes,resizable=yes');
}
</script>
</body>
</html>