且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

动态创建的ahref点击事件在Firefox或Safari浏览器中不起作用?

更新时间:2023-01-24 11:18:27

要使其在Firefox中运行,只需将新元素插入DOM(apendChild等).

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

我认为这不适用于Safari:

I don't think this will work in Safari:

    不支持
  • <a download="">(正确),AFIAK.例如. a.download =不会做您想要的.您仍然可以使用setAttribute,但是Safari仍然会忽略它.
  • 我认为Safari确实不支持下载blob:-URI.
  • <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.