最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Download attribute not working in Firefox but working in chrome - Stack Overflow

programmeradmin0浏览0评论

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

I have tried using this :

<p>Click on the w3schools logo to download the image:<p>

<a href=".jpg" download="aa">
  <img border="0" src=".jpg" alt="W3Schools" width="104" height="142">
    </a>

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

Link to fiddle : JsFiddle

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

I have tried using this :

<p>Click on the w3schools logo to download the image:<p>

<a href="http://www.w3schools./images/myw3schoolsimage.jpg" download="aa">
  <img border="0" src="http://www.w3schools./images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
    </a>

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

Link to fiddle : JsFiddle

Share edited Jan 16, 2023 at 17:05 scytale 12.7k4 gold badges34 silver badges46 bronze badges asked May 25, 2015 at 18:38 user3727204user3727204 651 gold badge1 silver badge6 bronze badges 4
  • No link to the jsFiddle – TheLifeOfSteve Commented May 25, 2015 at 18:39
  • jsfiddle/fztnwnbL - JsFiddle Lnk – user3727204 Commented May 25, 2015 at 18:39
  • Anyway, what exactly are you asking? – Sebastian Simon Commented May 25, 2015 at 18:44
  • Don't use absolute urls in your code. – digwig Commented May 25, 2015 at 19:24
Add a ment  | 

1 Answer 1

Reset to default 10

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./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

发布评论

评论列表(0)

  1. 暂无评论