window.open with target “_blank” in Chrome

后端 未结 5 1340
清歌不尽
清歌不尽 2020-12-06 10:20

I have a small javascript function which opens an url in a new tab:

function RedirectToPage(status) {
   var url = \'ObjectEditor.aspx?Status=\' + status;
           


        
5条回答
  •  旧时难觅i
    2020-12-06 10:43

    "_blank" is not guaranteed to be a new tab or window. It's implemented differently per-browser.

    You can, however, put anything into target. I usually just say "_tab", and every browser I know of just opens it in a new tab.

    Be aware that it means it's a named target, so if you try to open 2 URLs, they will use the same tab.

提交回复
热议问题