简体   繁体   中英

Javascript - Open page as _blank instead of pop up

In my Billing CMS (WHMCS) there's a page that redirects you to another page.

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.

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? 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

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

Here is the documentation on target .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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