Yishu Fang
Yishu Fang

Reputation: 9978

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)?

The popup window seems to be the same with just some minor differences.

pic1 (File->Save As):

enter image description here

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

enter image description here

(IE version 10)

Upvotes: 1

Views: 357

Answers (1)

James Donnelly
James Donnelly

Reputation: 128786

With File -> Save As you're saving the entirety of the web page that's been loaded (including any assets (CSS files, images, etc.)). 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".

Upvotes: 1

Related Questions