用_newtab 在 onclick 中用是没有问题的
window.open(url,'_newtab')但是不能用在网页加载中,打开另外一个窗口。现在的浏览器基本上都是要给堵住的<html>
<head>
<script>
function popitup(url) {
window.open(url,'_newtab');
}
</script>
</head><body>
<form>
<input type="button" value="Open Window" onclick="popitup('http://google.com')">
</form>
</body>
</html>
window.open(url,'_newtab')但是不能用在网页加载中,打开另外一个窗口。现在的浏览器基本上都是要给堵住的<html>
<head>
<script>
function popitup(url) {
window.open(url,'_newtab');
}
</script>
</head><body>
<form>
<input type="button" value="Open Window" onclick="popitup('http://google.com')">
</form>
</body>
</html>
window.open(url,'_newtab')但是不能用在网页加载中,打开另外一个窗口。现在的浏览器基本上都是要给堵住的<html>
<head>
<script>
function popitup(url) {
window.open(url,'_newtab');
}
</script>
</head><body>
<form>
<input type="button" value="Open Window" onclick="popitup('http://google.com')">
</form>
</body>
</html>
触发以上代码,必须用鼠标点击按钮才行。
我的意思是:不点击鼠标,直接用js触发打开“新标签页”。
1、用户回车或者点击 打开的第一个窗口
2、用div 或者 jquery ui dialiog. 因为用的是html TAG 浏览器没法堵