I want to open a url
in new tab.
I am using following code to open url in new tab.
var url = "/Billing/DownloadEDIForMultipleClaim?month=" + month + "&BillRequestIds=" + billRequestIds.join(',') + "&PatientIDs=" + patientIds.join(',');
window.open(url, '_blank'); //exception here
But this is not working for me it through an exception Uncaught TypeError: Cannot read property 'open' of undefined
I also used following.
var url = "/Billing/DownloadEDIForMultipleClaim?month=" + month + "&BillRequestIds=" + billRequestIds.join(',') + "&PatientIDs=" + patientIds.join(',');
var win = window.open(url, '_blank');
if(win) {
//Browser has allowed it to be opened
win.focus();
} else {
//Broswer has blocked it
alert('Please allow popups for this site');
}
I already seen related questions.
How to open a URL in a new Tab using javascript or jquery?
How to open a link in new tab using javascript
But this is not working for me.