gpt4 book ai didi

javascript - 如何在新的空白弹出窗口中打开pdf并下载

转载 作者:行者123 更新时间:2023-11-30 20:34:49 25 4
gpt4 key购买 nike

我正在尝试重现调试某些问题的场景,为此我需要单击日期,这会打开一个新的空白弹出窗口,并且会在该窗口中下载 pdf。到目前为止,我只能在同一窗口中下载 pdf,它不会在新窗口中打开,然后再下载。

尝试过的 HTML 代码:-

<a href="javascript:open('C://Users//abcd//Desktop//freeformatter-decoded.pdf','mypopuptitle','width=600,height=400')"  id="1" style="cursor: pointer; color: rgb(14, 87, 193); text-decoration: none;">First acc</a>

<a target="_blank" href="C://Users//abcd//Desktop//freeformatter-decoded.pdf">First acc</a>

下面的截图显示了我想重新创建的场景:-

enter image description here

点击 04/05/2018 后,应该会在新的弹出窗口中下载 pdf。请注意,弹出窗口是空白的,它只是下载 pdf。请帮助编写上面的 html/javascript。我需要重新创建确切的用例。

最佳答案

<a target="_blank" href="C://Users//abcd//Desktop//freeformatter-decoded.pdf" download>First acc</a>使用 download您可以下载的属性

关于javascript - 如何在新的空白弹出窗口中打开pdf并下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49954509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com