Does execCommand SaveAs work in Firefox?
问题 Why does this not work in ff/chrome? javascript: document.execCommand(\'SaveAs\',\'true\',\'http://www.google.com\'); (used as a bookmarklet) 回答1: execCommand is not completely standardized across browsers. Indeed, execCommand('SaveAs', ...) only seems to be supported on IE. The recommended way to force a save-as would be to use a content-disposition: attachment header, as described in http://www.jtricks.com/bits/content_disposition.html Since this is part of the HTTP header, you can use it