SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,729
    Mentioned
    31 Post(s)
    Tagged
    0 Thread(s)

    geverating VISIBLE HTML with js?

    I have a script( more of a web app) which generates a customized table element. I want the user to be able to "save" this table. Thus far , what I am doing is getting the HTML of the table and displaying in a textarea for the user to cut and paste to a text editor. This is fine, except , I worry MANY in my target audience wont know how to use a text editor, or make plain text, or save as HTML.. etc.

    So I was hoping to use .js to open a new window and write in the HTML so that the users could merely do a FILE>SAVE PAGE AS directly from their browsers.

    I suppose I have two questions:

    1) how do I document.write to a NEW window??

    2) I have noticed that when you use.js to generate HTML, it doesnt show in the view source , thus it wont "save as" anything else but a BLANK doc, and I was hoping someone could advice me as to how to make generated HTML "visible" so that it can be saved.

    Maybe I am going about the this the wrong way.. so any advice is appreciated.

  2. #2
    SitePoint Addict
    Join Date
    Sep 2007
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look into data URIs. I think it can help you accomplish what you're trying to do. Generate a data uri using Javascript and then open a new window using that URI. Check this out: http://software.hixie.ch/utilities/cgi/data/data

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,729
    Mentioned
    31 Post(s)
    Tagged
    0 Thread(s)
    THANK YOU. you are in deed dman.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •