替换网址后如何运行

时间:2018-12-01 19:28:36

标签: javascript jquery

这是我的代码,要运行此mailTab.$('#username').val(username);,我必须首先等待mailTab.window.location.href = mailTab.window.location.href.replace("step=4", "step=3")完成加载,所以问题是我应该如何/在何处放置此代码? mailTab.$('#username').val(username);

<script>
window.onload = _ => {
    $(`#certform input[type='submit']`).click(_ => {
        const username = $(`#certform input[name='username']`).val();
        alert(username);
        const mailTab = window.open(`admin/index.php?module=user-mass_mail&action=resend&mid=21`);

        mailTab.onload = _ => {
            mailTab.window.location.href = mailTab.window.location.href.replace("step=4", "step=3")



        }
    });
}
</script>

0 个答案:

没有答案