草庐IT

anchorTag

全部标签

html - A 标签上的下载属性在 IE 中不起作用

我通过以下代码创建了一个动态anchor标记,用于下载文件。此代码在Chrome中运行良好,但在IE中运行不佳。我怎样才能让它工作SampletitleClickmefunctionclicker(){varanchorTag=document.createElement('a');anchorTag.href="http://cdn1.dailymirror.lk/media/images/finance.jpg";anchorTag.download="download";anchorTag.click();varelement=document.getElementById('d

html - A 标签上的下载属性在 IE 中不起作用

我通过以下代码创建了一个动态anchor标记,用于下载文件。此代码在Chrome中运行良好,但在IE中运行不佳。我怎样才能让它工作SampletitleClickmefunctionclicker(){varanchorTag=document.createElement('a');anchorTag.href="http://cdn1.dailymirror.lk/media/images/finance.jpg";anchorTag.download="download";anchorTag.click();varelement=document.getElementById('d