Reputation: 65
I am downloading a pdf file...and i want to open its in new tab..am using this code
var filename = result.get('sProviderName')+'-TSCA.pdf';
var downloadLink = document.createElement("a");
downloadLink.href = global.rootUrl + 'administrations/TscaDownload/'+iProviderId+'/'+filename;
window.open(downloadLink.href,"TSCA", "", "");
but the browser open the url in new tab and downloading...its not showing pdf file.
can anyone help me to do this pls...
Upvotes: 3
Views: 21738
Reputation: 11859
try like this:use _blank for new tab
window.open(downloadLink.href,'_blank');
Upvotes: 3