Skip to content Skip to sidebar Skip to footer

Save A Html Page In Firefox Using Javascript

I want to save a HTML page using JavaScript in Firefox. I've tried the code below, but it only works in IE: function doSaveAs() { if (document.execCommand) { document.e

Solution 1:

This only works in IE.

Simply tell the user to hit CTRL+S if he wants to save a page. You could also link to a php script which sends the page with appropriate headers (Content-Disposition: attachment; filename="document.html") forcing a download window if all the user should save is the HTML page (i.e. without any images, css, etc.).

Post a Comment for "Save A Html Page In Firefox Using Javascript"