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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Javascript page and Saving as HTML!? 1

Status
Not open for further replies.

notimportant

Technical User
Oct 5, 2006
3
KW
Dear all,

I'm not sure this is the right place for talking about this issue! I'm writng a javascript code that generates a table with desired properties. I have linked a HTML page that includes a .js file. When the table is generated with document.write(), the screen is wiped and table appears. I want to give users the ability to save the new page but selecting menu-> file -> Save as

But when I do this the original HTML page is savedand not the new generated table page. So I have to save the source of the new page in notepad which eliminates Unicode. Plz Help me find a way for saving directly from File->Save AS

Regards,

Siavash
 
Since the table is written dynamically after the page is loaded into the browser, you won't be able to accomplish what you want. You'll have to use some kind of server-side scripting to create the actual HTML for the page, then have your users save that.

Lee
 
If you're using FireFox (or any of the Geckos), you can get the generated code rather then the regular source code. One way is selecting the area and choosing 'view selection source' or via additional plug-ins like web developer toolbar.
 
This is for his users who won't necessarily want to jump through hoops different from what they're used to in order to get the data. Since ~75% of the browser usage is with IE, instructions for Firefox probably wouldn't be practical.

Lee
 
Thank you all for your support!

Currently I have found a way by a friend. If you choose in the file->Save as menu option: Web Page, HTML only, in The "Save as type" section, the generated text will be saved correctly and the Unicode won't be lost! Just this should be explained to users that are using the program.

Any new resolution will be appreciated.

Siavash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top