0

Here is my question.
First , I create an anchor tag.
For example , <a id="download_link" href="www.google.com">

Then I use jQuery to trigger "click" event.

$("#download_link").click()

It works well in Chrome but Safari I searched a lot solution like this

But they also couldn't solve my problem. How can I solve this problem?

[Update] I use the link to download something. The complete code is:

$('body').append('<a id="download_link" download style="display:none;"></a>')

$("#download_link").attr({
  'href': /* my download url */,
}).get(0).click();
Community
  • 1
  • 1
Jay Chung
  • 109
  • 1
  • 10

0 Answers0