简体   繁体   English

Javascript-将页面打开为_blank而不是弹出窗口

[英]Javascript - Open page as _blank instead of pop up

In my Billing CMS (WHMCS) there's a page that redirects you to another page. 在我的Billing CMS(WHMCS)中,有一个页面可将您重定向到另一个页面。

The problem is that this redirected page is being opened as a Pop Up, and I'm looking for the source of it to make it open in target="blank" instead. 问题是此重定向的页面正在作为弹出窗口打开,而我正在寻找它的源,以使其在target =“ blank”中打开。

This is the redirect script I found in the page that originates the pop up: 这是我在弹出页面中找到的重定向脚本:

<script language="javascript">
setTimeout ( "autoForward()" , 0 );
function autoForward() {
    var submitForm = $("#submitfrm").find("form");
    submitForm.submit();
}
</script>

Can this function trigger the Pop Up? 此功能可以触发弹出窗口吗? Is there a way to change it to _blank by adding something to the code above? 是否可以通过在上面的代码中添加一些内容来将其更改为_blank? If not, what should I look for to find the source of this function? 如果没有,我应该寻找什么来找到此功能的来源?

Thanks!! 谢谢!!

If you have control over that function, set the form's target 如果您可以控制该功能,请设置表单的target

function autoForward() {
    var submitForm = $("#submitfrm").find("form");
    submitForm.prop('target', '_blank');
    submitForm.submit();
}

Here is the documentation on target . 这是有关target的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM