简体   繁体   English

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

[英]In IE, what's the difference between File->Save As and document.execCommand('SaveAs')?

In IE, what's the difference between File->Save As (pic1) and document.execCommand('SaveAs') (pic2)? 在IE中,“ 文件”->“另存为” (pic1)和document.execCommand('SaveAs') (pic2)有什么区别?

The popup window seems to be the same with just some minor differences. 弹出窗口似乎相同,只是有一些细微的差别。

pic1 ( File->Save As ): pic1( File-> Save As ):

在此处输入图片说明

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

在此处输入图片说明

(IE version 10) (即IE版本10)

With File -> Save As you're saving the entirety of the web page that's been loaded (including any assets (CSS files, images, etc.)). 使用“ 文件”->“另存为”,您可以保存已加载的整个网页(包括所有资产(CSS文件,图像等))。 This is why the save as type here is set to "Webpage, complete". 这就是为什么此处的保存类型设置为“完整的网页”的原因。

With document.execCommand('SaveAs') you're saving the HTML document specifically without any of the assets, which is why the save as type in this case is "HTML File". 使用document.execCommand('SaveAs')您将专门保存HTML document而没有任何资产,这就是为什么在这种情况下, 另存为 “ HTML File”的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM