title: Permission denied for clicking link in Internet Explorer 11
body: <p>I modified an existing AngularJS-App, which lists customers, by adding a button, that allows to download the customer information as a vcard. I create the vcard in Javascript directly on click. The download-button calls the following function on click with the customer-item as argument:</p>
  
  <pre><code>function transcodeToAnsi(content){
    var encoding = "windows-1252";
    var nonstandard = {NONSTANDARD_allowLegacyEncoding: true};
    return new TextEncoder(encoding, nonstandard).encode(content);
  }
  
  $scope.download = function(item) {
    var filename = 'contact.vcf';
    var aId = "vcard";
  
    var content = createVCard(item);
    var encoded = transcodeToAnsi(content);
  
    var blob = new Blob([ encoded ], { type : 'vcf' });
    var url = (window.URL || window.webkitURL).createObjectURL(blob);
  
    $("body").append('&lt;a id="' + aId + '" href="' + url + '" download=' + filename + ' class="hidden"&gt;&lt;/a&gt;');
    $timeout(function(){
      document.getElementById(aId).click();
      $("#" + aId).remove();
    })
  
    return false;
  }
  </code></pre>
  
  <p>In the createVCard-function I just create the file content as a String, so it should not enter into the problem. The transcoding is done by this library: <a href="https://github.com/inexorabletash/text-encoding" rel="noreferrer">https://github.com/inexorabletash/text-encoding</a></p>
  
  <p>The function works without problem in Firefox and Chrome, but not in IE11. The following error is given in the console:</p>
  
  <pre><code>Error: Permission denied
  at Anonymous function (http://***/Contacts2015/js/contacts.js:169:9)
  at Anonymous function (http://***/static/9bojdXAkdR8XdVMdSTxZAgzEwGWhHMwgpuONdU2Y8F4.js:14305:11)
  at completeOutstandingRequest (http://***/static/9bojdXAkdR8XdVMdSTxZAgzEwGWhHMwgpuONdU2Y8F4.js:4397:7)
  at Anonymous function (http://***/static/9bojdXAkdR8XdVMdSTxZAgzEwGWhHMwgpuONdU2Y8F4.js:4705:7) undefined
  </code></pre>
  
  <p>Line 169 is this instruction of the function above:</p>
  
  <pre><code>document.getElementById(aId).click();
  </code></pre>
  
  <p>The same error is displayed, when this statement is input in the console manually.</p>
  
  <p>I would appreciate every hint about the reason and even more a good workaround.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Corrected error-line and typo.</p>