JS模拟超级链接下载文件

JS模拟超级链接下载文件

<script>

  var a=document.createElement("a");
   document.body.appendChild(a);
   a.setAttribute('href','openlayerexample.zip');   
   a.click();
script>

你可能感兴趣的:(javascript)