JavaScript:location.href在新窗口/标签中打开?(JavaScript: location.href to open in new window/tab?)
我有一个来自第三方开发人员的JavaScript文件。 它具有将目标页面替换为目标的链接。 我想在这个新标签中打开这个页面。
这是我到目前为止
if (command == 'lightbox') { location.href="https://support.wwf.org.uk/earth_hour/index.php?type=individual"; }谁能帮我吗?
I have a JavaScript file from a third party developer. It has a has link which replaces the current page with the target. I want to have this page opened in a new tab.
This is what I have so far:
if (command == 'lightbox') { location.href="https://support.wwf.org.uk/earth_hour/index.php?type=individual"; }Can anyone help me out?
最满意答案
window.open( 'https://support.wwf.org.uk/earth_hour/index.php?type=individual', '_blank' // <- This is what makes it open in a new window. ); window.open( 'https://support.wwf.org.uk/earth_hour/index.php?type=individual', '_blank' // <- This is what makes it open in a new window. );更多推荐
页面,JavaScript,command,电脑培训,计算机培训,IT培训"/> <meta name="descrip
发布评论