[Javascript/Vue] How to solve the problem of jumping to a new page from a hyperlink in js without being blocked by the browser? (Solved, code example, pro test is effective)

How to solve the problem of jumping to a new page from a hyperlink in js without being blocked by the browser? (Solved, code example, pro test is effective)


<body>
    ======== aaa.html ==========


    <a href="javascript:void(0)" onclick="window.open('http://www.baidu.com','_blank')">aaaaa</a>

</body>


<script>

    var form = document.createElement('form');
    form.action = 'www.baidu.com?id=1';
    form.target = '_blank';

    form.method = 'POST';

    document.body.appendChild(form);
    form.submit();

</script>

Guess you like

Origin blog.csdn.net/dxnn520/article/details/128690093