22智能在线
新记
js 中怎样在一个新页面打开
不要window。open
举报该文章
相关建议 推荐于2017-11-25
1.超链接<a href="
http://www.jb51.net
" title="脚本之家">Welcome</a>
等效于js代码
window.location.href="
http://www.jb51.net
"; //在同当前窗口中打开窗口
2.超链接<a href="
http://www.jb51.net
" title="脚本之家" target="_blank">Welcome</a>
等效于js代码
window.open("
http://www.jb51.net
"); //在另外新建窗口中打开窗口
温馨提示:内容为网友见解,仅供参考
当前网址:
https://22.t2y.org/zz/262tfc6ci.html
其他看法
第1个回答 2013-08-01
<a href=""
www.baidu.com/
" target="_blank">百度</a>
第2个回答 2013-08-01
location.replace("
http://www.baidu.com/"
);
第3个回答 推荐于2016-09-06
document.location.href="";
或者
window.location.href="";
均是不以新窗口打开,直接替换原来的窗口本回答被提问者采纳
相似回答
大家正在搜
相关问题
如何用js实现 在当前页面打开新页面 而不是在新窗口打开
js打开网址,如何让在新窗口中打开
请教一个js语法:window.open()在IE中只是打开...
js中怎样在一个新页面打开?
怎么让JS 里的图片链接成为在新窗口打开
如何用JS实现在当前页面打开新页面,而不是在新窗口打开?
javascript中用window.open(url)方法...
js语句location.href怎么让它到新窗口打开