Test page screenshoot

Wake Up!

  1. Copy on your server the files: "html2canvas.js", "save_screenshoot.js", "save_screenshoot.php"; and the folder "screenshoot"
  2. Copy the following code and add it to the end of the html page content (before the ending tag </body>):

    <script src="html2canvas.js"></script>
    <script src="save_screenshoot.js" id="js_save_scrht"></script>
    <script>
    //css selector that represents the html element to which to take screenshoot
    var scrn_elm ='body';

    //name of the PNG image with the screenshoot to save on server
    //here, page name without extension
    var scrn_img = location.pathname.match(/[^\/]+$/i)[0].replace(/\.(.*?)$/i, '');

    //object that get the screenshoot
    var save_scrht = new saveScreenshoot({elm:scrn_elm, img:scrn_img});
    </script>

- In the scrn_elm variable it is defined the css selector that represents the html element to which to take screenshoot. Default "body", takes a screenshoot of all the page.
- In the scrn_img variable it is defined the name of the PNG image with the screenshoot to save on server. Default, page name from URL (without extension).

After the screenshoot is saved, the ajax script will add a "See Screenshoot" link (after button) which will open a window with the PNG image.



CoursesWeb.net