Is it possible to take a screenshot with javascript and save it? Because I use the drag script from dynamicdrive to make images kinda like a puzzle, so how could I use js to take a screenshot of the final image and save it to a folder?
Printable View
Is it possible to take a screenshot with javascript and save it? Because I use the drag script from dynamicdrive to make images kinda like a puzzle, so how could I use js to take a screenshot of the final image and save it to a folder?
More specifically, im making it offline, so i want a link that will take a screenshot, save it as a .jpg, .png (my choice) and save it to the root folder
No, it isn't possible.
If you know Java, however, you can use the Robot class to take a screenshot (given the user's permission).
You can however capture the location.href of the page and send the query to a perl script to your server using the html2png command. And make a new javascript array to display the images.
By the way u can download html2png from this: http://marginalhacks.com/Hacks/html2jpg/
Clever, but requires X11, which one doesn't usually find running on a server (contrary to what Dan Brown may think...).
Then I think that there is only one way to do it. Add that kind of functionality to JS 1.5 by downloading either spidermonkey or Rhino from mdc.
Heh :)
Unfortunately, I doubt the Mozilla Foundation would approve such a patch... ;)
Who knows if they do?? anyways it is a client side property.
Because it would be against the principles of browser-embedded ECMAScript, besides introducing hundreds of potential new security holes for a feature hardly anyone would use.
It is a client-side task, yes. That doesn't mean it must be done in ECMAScript.