I have a purchase success page that has an anchor to show the invoice as a PDF such as
<a href="link" id="anchorId" target="targetId" style="display: none;">Click</a>
That purchase invoice has to be opened automatically, so I did like below:
<script type="text/javascript">
$(document).ready(function () {
$('#anchorId')[0].click();
});
</script>
But browsers are not showing the new tab indicating this as a popup. I haven't used window.open
so as not to have this kind of browser behaviour.
Is there anything doable to accomplish my use case?