Skip to content Skip to sidebar Skip to footer

Dynamically Created Ahref Click Event Not Working In Firefox Or Safari?

i am creating ahref tag dynamically using javascript to download csv file generated using javascript code. The following code is working fine in chrome but doesn't work in safari o

Solution 1:

To make it work in Firefox, just insert the new element into the DOM (apendChild, etc).

I don't think this will work in Safari:

  • <a download=""> isn't (properly) supported yet, AFAIK. E.g. a.download = will not do what you want. You could still use setAttribute but Safari will still ignore it.
  • I don't think Safari does support downloading of blob:-URIs, anyway.

Post a Comment for "Dynamically Created Ahref Click Event Not Working In Firefox Or Safari?"