下载属性在Firefox中不起作用,但是在Chrome中工作 [英] Download attribute not working in Firefox but working in chrome

查看:84
本文介绍了下载属性在Firefox中不起作用,但是在Chrome中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个小提琴并不适用于firefox,而是使用chrome。



我试过使用这个:

点击w3schools标志下载图片: b




注意:下载属性在IE,Safari或Opera版本12(及更早版本)中不支持。



链接到小提琴:JsFiddle

解决方案

首先在firefox中,你不能标记一个元素从另一个域下载
,所以像这样一个不会工作

 < a href =http://www.w3schools.com/images/myw3schoolsimage.jpg下载> 

但这个其他的可以在firefox上使用

 < a href =img / book.png下载> 

Firefox需要来自同一个域名,所以相对网址才能正常工作。



:) goog luck

This fiddle is not working in firefox but working in chrome.

I have tried using this :

Click on the w3schools logo to download the image:

Note: The download attribute is not supported in IE, Safari or Opera version 12 (and earlier).

Link to fiddle : JsFiddle

解决方案

first of all in firefox, you cant mark an a element to download from another domain so an a like this wont work

    <a href="http://www.w3schools.com/images/myw3schoolsimage.jpg" download>

but this other will work on firefox

    <a href="img/book.png" download>

Firefox need to be from the same domain, so a relative url, will work fine.

:) goog luck

这篇关于下载属性在Firefox中不起作用,但是在Chrome中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆