javascript 加载资源失败:在 Safari 浏览器中下载多个文件时帧加载中断
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27979045/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failed to load resource:Frame load interrupted in Safari browser while downloading multiple files
提问by Jeevitha G
I am having download feature in my application. Here we can download multiple file as well. I am getting this error - **Failed to load resource:Frame load interrupted in Safari browser while downloading multiple files**
我的应用程序中有下载功能。在这里我们也可以下载多个文件。我收到此错误 -**Failed to load resource:Frame load interrupted in Safari browser while downloading multiple files**
The issue is Only in safari. the download works fine in other browsers(Firefox, Chrome and IE).
问题仅在 safari 中。下载在其他浏览器(Firefox、Chrome 和 IE)中运行良好。
I am using anchor tag to download .how to download file using anchor tag <a>
我正在使用锚标记下载 . 如何使用锚标签<a>下载文件
采纳答案by Tharindu
I had the same issue with Safari In my case I am creating a svg file and then converts it to a pdf file that's the file I'm downloading it works in other browsers (firefox, chrome) except for safari. (I didn't check this on IE)
我在 Safari 上遇到了同样的问题在我的情况下,我正在创建一个 svg 文件,然后将其转换为一个 pdf 文件,该文件是我正在下载的文件,它适用于除 safari 之外的其他浏览器(firefox、chrome)。(我没有在 IE 上检查这个)
The problem with my code was there was missing 'xmlns=http://www.w3.org/2000/svg'
attribute in the svg
tag this fixed my problem hope this helps you
我的代码的问题是标签中缺少'xmlns=http://www.w3.org/2000/svg'
属性svg
这解决了我的问题希望这对您有所帮助
回答by Christian Juth
The anchor tag download attribute does not work in Safari. I am not sure if this error you are getting is related but the download will not work in Safari regardless.
锚标记下载属性在 Safari 中不起作用。我不确定您遇到的此错误是否相关,但无论如何下载都无法在 Safari 中运行。
Source http://www.w3schools.com/tags/att_a_download.asp
来源 http://www.w3schools.com/tags/att_a_download.asp
You can try this jQuery plugin, which allows you to download files through javascript. I tested it and it seems to work in Chrome and Safari and is tested on all the other major browsers.
你可以试试这个 jQuery 插件,它允许你通过 javascript 下载文件。我测试了它,它似乎可以在 Chrome 和 Safari 中工作,并且在所有其他主要浏览器上都经过了测试。