[RESOLVED]How to open popups on new tab?

Hi All,

I want to open the popups(more than 1 at a time) on new tab.

hdnarrID has ID(s) with comma separated

My Code:

function TNToDownload() {       
        var arrRes=$("#hdnarrID").val();      
        var strResult=arrRes.split(',')
        for(var i = 0; i < strResult.length-1; i++)
{ window.open('/download/sample/'+strResult[i]); } }

Above method get call on button click and it  works fine with IE and Mozilla browser. It fails on Chrome browser.

Thanks in Advanced

Netra S W

It’s my understanding that this is client defined behaviour, i.e. how the user has their browser options set, however this thread seems to suggest a solution you may find works

"window.open must be called within a callback which is triggered by a user action (example onclick) for the page to open in a new tab instead of a window."


Generally, you can use the ‘_blank’ target to indicate that you want to open a window within a new tab :


Hi Rion William,

I have tried this too. But the result is only one new tab gets created and rest of all get open as new window.


Netra S W

You might also try using something like a generic new variable instead of "_blank" to see if that makes any difference :

window.open('/download/sample/'+strResult[i],'_blank' + i.ToString());

Leave a Reply