Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving page as HTML file

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
GB

I want to give my site users the facility to download a page as a .html file. They can do this already from within IE by selecting File->Save As and filling in the resulting dialog, but not all users will be familiar with this feature :-(

Question: How can I create a button (or link) on the page, which when pressed, brings-up the same dialog as mentioned above? Eg. is there an onclick=... command I can use? Alternatively, could I somehow stuff Alt-F,'A' into a keypress buffer, which (hopefully) would also produce the desired effect?

Many thanks,
Alan
 
Make a normal link... for example:

You want your visitors to be able to save products.html as a html file to their computer, so they can view the page offline.

Somewhere on the page, make a link as follows:

<a href=&quot;products.html&quot;>Products</a>

Remember to include the full directory if products.html is not in the same directory as the page you're putting the link on.

Now underneath write something like &quot;Right Click on the link and choose &quot;save target as&quot;.

When a visitor does this, the save file dialog box will appear, and the save as type is already set to html file... all they have to do is choose where to save it to!
Adam

PC-Tek Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top