gpt4 book ai didi

javascript - 在 IE 中,文件->另存为和 document.execCommand ('SaveAs' 之间有什么区别?

转载 作者:行者123 更新时间:2023-11-27 23:28:24 25 4
gpt4 key购买 nike

在 IE 中,文件->另存为(图 1)和 document.execCommand('SaveAs')(图 2)有什么区别?

弹出窗口似乎是相同的,只是有一些细微的差别。

pic1(文件->另存为):

enter image description here

pic2 (document.execCommand('SaveAs')):

enter image description here

(IE版本10)

最佳答案

使用文件 -> 另存为,您可以保存已加载的整个网页(包括任何资源(CSS 文件、图像等))。这就是为什么这里的保存类型设置为“网页,完整”。

使用document.execCommand('SaveAs'),您可以专门保存 HTML 文档,而无需任何资源,这就是为什么保存为类型在本例中是“HTML 文件”。

关于javascript - 在 IE 中,文件->另存为和 document.execCommand ('SaveAs' 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34767092/

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