SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Saving .html within an iFrame

    Hello All,

    I am wondering is it possible to save a .html file from within an iFrame at all?

    Basically what I need is a default .html page to show in an iFrame. This default.html page will show a report on it, which when ammended and filled in, I need to be able to "Save as.." JUST that default.html file and change it's name and location.

    Is this possible at all, if so does anyone know how?

    Also if anyone can think of a better way to achieve the same idea please feel free I am open for ideas - this was just something that popped in to my head this morning xD

    Thanks in advance for your help,

    Bernie

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    You can do one of two things...

    1) Right click inside the iframe window, view source, then save the HTML
    2) Right click inside the iframe window, properties, copy the URL, place the URL in the address bar, and then use file > save as.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank for your fast response. Is there any way of creating a button, maybe using some JS I'm not sure?

    The user's that will be doing this are let's say...not technically minded so the easier it is the better :-)

    Thanks,
    Bernie

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Code JavaScript:
    <form>
    <input type="button" onClick="document.execCommand('SaveAs') " value="save">
    </form>

    That should do the trick, as the command being invoked is dependant on JavaScript it doesn't matter that it's obtrusive (in the HTML rather than called via an external JavaScript file like I would usually recommend).

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's great thankyou so much!

    Really appreciate your quick respone :-)

    Many thanks again,

    Take care,
    Bernie

  6. #6
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


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
  •