How to simulate target=“_blank” in JavaScript

前端 未结 7 1734
旧巷少年郎
旧巷少年郎 2020-12-02 08:05

When a user clicks on a link, I need to update a field in a database and then open the requested link in a new window. The update is no problem, but I don\'t know how to op

7条回答
  •  孤街浪徒
    2020-12-02 08:20

    This might help you to open all page links:

    $(".myClass").each(
         function(i,e){
            window.open(e, '_blank');
         }
    );
    

    It will open every link items to another tab like you would had clicked each one.

    You only need to paste it to browser console. jQuery framework required

提交回复
热议问题