I have an <a href="" class="auto_download" />
and would like to trigger, through Javascript a click
(currently using jQuery; but some JS equivalent is ok too).
$('auto_download')[0].click();
Actually it works correctly if the <a href="" />
has a target="_blank"
attribute; but the pop-up is blocked from the major browsers.
So, to avoid the issue, I removed the target=_blank"
and it now does NOT work anymore.
I guess this is related to some security policy of the browsers regarding what can be automatically clicked.
I've read different questions, I've seen many different solutions on SO, but couldn't find one that could be really cross-browser.