Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: how i can SAVEAS a web page programmaticaly with html5/js

  1. #1
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default how i can SAVEAS a web page programmaticaly with html5/js

    how i can SAVEAS a web page programmaticaly with html5/js? If only an image on page it will save image instead?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,933
    Thanks
    16
    Thanked 303 Times in 302 Posts
    Blog Entries
    9

    Default

    What do you mean?

    If its an HTML5 web page that you've made, in Notepad or Dreamweaver etc, you just save it on your computer with an htm/html extension. The js can be internal, or if its an external file, save it with the js extension.

    If you want to save/download a live HTML5 web page, you go to the browser's tool or options menu and there'll be an option to save the web page. When prompted, choose the option for saving as a 'complete' web page and then it, and all of its resources (external js and images, etc) will be saved to your computer too.

    I think IE (9 for sure) will sometimes save the web page with a different DOCTYPE - it will put a transitional one above the HTML5 DOCTYPE - but just edit the saved web page to take the extra one out.

    In either case, if the web page has a different DOCTYPE to begin with, you would need to convert it to include HTML5 tags/ HTML5 DOCTYPE
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    like on file upload there isn't file save dialog? save in client not localStorage a whole page or image or another web page file loaded?

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,933
    Thanks
    16
    Thanked 303 Times in 302 Posts
    Blog Entries
    9

    Default

    Sorry, I really have no idea what you're talking about

    What file upload are you referring to? Is it a file upload feature on your web host? Or are you describing something on your FTP client?

    Please try to use complete sentences and explain what you're trying to do from the very beginning. Please state your intentions, what you're trying to accomplish and also software, tools or scripts you're using.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  5. #5
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    I mean like input tag of type file, the dialog appear when browse pressed...

    same appear with a event handler but save as dialog (not browse dialog) to save the image or canvas to hdd or mobile ram, well?

  6. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,933
    Thanks
    16
    Thanked 303 Times in 302 Posts
    Blog Entries
    9

    Default

    Are you referring to a CMS to save updates/changes made to a web page?
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  7. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    lse123,

    You need to explain your questions more clearly.


    For example, your original post would seem to indicate that you want to save an entire webpage (and its resources, images, scripts, etc.) to your computer. However, subsequent posts seem to contradict that.

    Please describe, specifically, what you're working with and what you want to accomplish. If you can find examples of the functionality you want on other websites, please share those URLs. Situational examples, or even sketches, may help also.

    It's "okay" if your question is long, as long as that helps us figure things out.

    If you don't mind my asking, is English your native language? If not, there might be someone on the forum that can help you translate. You might also post your question in your native language, alongside English, so we can try to help translate.

  8. #8
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    I have a canvas and I want: pressing a button or link appear the saveas dialog to save this canvas as png without leave page, just like firefox dialog "Save Image As" (right click) menu option, well?

    I saw some commands by searching but did not make it...


    Code:
        function saveAs(f) { 
          if(typeof document.execCommand == "object") { 
            document.execCommand("SaveAs",true,f); 
          } 
          else { 
            alert("From the File Menu, Select Save As ... to Save.") 
          } 
        }

  9. #9
    Join Date
    Jan 2012
    Posts
    74
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    also may save some localStorage data as txt file in PC or mobi device, ...?

  10. #10
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by lse123 View Post
    I have a canvas and I want: pressing a button or link appear the saveas dialog to save this canvas as png without leave page, just like firefox dialog "Save Image As" (right click) menu option, well?
    This tutorial describes how to do exactly that.

    Note that this is the second search result for "save html canvas as png". We are not Google - please do your own research to start with. If you have specific problems making code work, or if you've done your research and can't find anything, we're happy to help.

Similar Threads

  1. Replies: 2
    Last Post: 12-04-2012, 07:48 PM
  2. UTF-8 with HTML5
    By techno_race in forum Coding tips & tutorials threads
    Replies: 16
    Last Post: 06-23-2012, 06:03 PM
  3. HTML5 help
    By john123a in forum HTML
    Replies: 3
    Last Post: 06-30-2011, 12:42 AM
  4. saveAs webPage via javascript ?
    By vmars316 in forum JavaScript
    Replies: 2
    Last Post: 05-18-2010, 03:41 AM
  5. execCommand(SaveAs)
    By losbluejeans in forum JavaScript
    Replies: 1
    Last Post: 04-05-2005, 06:56 AM

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
  •