-1

I have a anchor tag as follows:-

<a id="lnkAvailabilityBrochure" href="" style="visibility:hidden" download></a>

and the click event of a div is bound to the following method that simulates clicking the above hyperlink:-

var downloadPropertyBrochure = function () {
        if (propertyBrochure.BrochureId != EmptyGuid){
            $("#lnkPropertyBrochure").attr("href", propertyBrochure.ViewUrl);
            $("#lnkPropertyBrochure")[0].click();
        }
        else
        {
            $.growlUI("There is no brochure to download..");
        }
    }

This works just fine in chrome and also in IE 11 it opens the download but IN THE SAME WINDOW !! How can I prevent this. How can I force download and not allow to open in the same page. Any ideas ?

SaiBand
  • 5,025
  • 15
  • 57
  • 76

1 Answers1

2

That's because the download attribute is not supported by IE 11:

https://caniuse.com/#search=download

Randy Casburn
  • 13,840
  • 1
  • 16
  • 31
  • thats correct. IE 13 is the first version that supports it. https://www.w3schools.com/tags/att_a_download.asp – SaiBand Nov 28 '18 at 00:12