How to open a pdf in iOS 10.3.3 safari browser in a new tab using javascript. The html element is hidden on which the virtual click will happen.
<a id="obv-download" target="_blank" download="download" href=""></a>
Using Ajax href field is getting filled and I need the same anchor link to open in new tab.The code which I am using for opening the pdf is below (working fine till iOS 10.2).
$('#id_of_elem').attr('href', url);
var click_ev = document.createEvent("MouseEvents");
click_ev.initEvent("click", true, true);
document.getElementById("id_of_elem").dispatchEvent(click_ev);
I already tried
$("#id_of_elem").click();
and
window.location.href('link');
But they did not workout.
Please help me