Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 09-16-2005, 04:02 PM
  #1
xingyu
Novice (Level 1)
 
Join Date: Jul 2005
Posts: 9
iTrader: (0)
xingyu is an unknown quantity at this point
Question How to save an HTML page by using javascripts

Dear Fellows:

An HTML page has been populated at the client side. I want a user be able to save all of its contents on the client machine. I know that this action can be done by clicking the IE menu File/Save As. However, I would like my user to click a button on the HTML page to call a javascript function, which save the contents of the dispalyed HTML page as a local HTML file. The problem is, what is the javascirpt codes.

Thanks for help;

XY
xingyu is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-16-2005, 04:23 PM
  #2
RysChwith
Super Guru
 
Join Date: Jun 2004
Posts: 4,117
iTrader: (0)
RysChwith will become famous soon enough
It can't be done in precisely that fashion. The only thing you could do would be to save the data in cookies, which the page (they'd still have to access it on your server) would load the next time they visited. JavaScript does not have any file writing capabilities otherwise.

Rys
RysChwith is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-16-2005, 04:38 PM
  #3
xingyu
Novice (Level 1)
 
Join Date: Jul 2005
Posts: 9
iTrader: (0)
xingyu is an unknown quantity at this point
Thank you very much
xingyu is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 01-26-2006, 09:22 AM
  #4
Kakoo
Novice (Level 1)
 
Join Date: Jan 2006
Posts: 3
iTrader: (0)
Kakoo is an unknown quantity at this point
Hello,
I have the same needs.
Is there any possibility (maybe using other things than javascript) to save a page with a button on the HTML page ?
For information, my pages are generated by a cgi script in tcl.

Moreover it would be wondefull if there were a mean to precise the initial dir to save the page.

Thanks a lot for future answers.
Kakoo is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 01-27-2006, 11:11 AM
  #5
Kakoo
Novice (Level 1)
 
Join Date: Jan 2006
Posts: 3
iTrader: (0)
Kakoo is an unknown quantity at this point
I just found an easy solution on another forum.
For information it is putting this in body:

<input name="Save" type="button" value="Save" onClick="javascript:document.execCommand('SaveAs','true','c:\\myHtmlDirectory\\myHtmlSavedPage.htm') ">
Kakoo is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 01-27-2006, 12:20 PM
  #6
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Kakoo,
Quote:
I just found an easy solution...
Easy it may be, but bear in mind that it will only work in IE.
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 01-27-2006, 01:54 PM
  #7
Kakoo
Novice (Level 1)
 
Join Date: Jan 2006
Posts: 3
iTrader: (0)
Kakoo is an unknown quantity at this point
Yes i know .
But maybe i will find a way of doing this in firefox too.
I'm already happy to have found this.
Kakoo is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 10:36 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.