JavaScript代码,无需使用ActiveX即可获取网站的屏幕截图 [英] JavaScript code to take a screenshot of a website without using ActiveX
问题描述
我有一个用户与之交互的JavaScript应用程序。我需要在当前时间保存界面的外观,裁掉我需要的部分(或者只通过指定div来拍摄我需要的部分),然后将其发送回服务器。
I have a JavaScript application that an user interacts with. I need to save the appearance of the interface at the current time, crop out the part that I need (or only shot the part that I need by specifying the div), and send it back to the server.
显然,任何外部服务都无法做到这一点,我需要一个JavaScript(或 Flash )脚本可以保存屏幕外观。这可能吗?
Clearly any external services would not be able to do this, I need a JavaScript (or Flash) script that can save the screen appearance. Is this possible?
另外,正如下面的评论所说,我不能使用ActiveX。
Also, as the comment below says, I cannot use ActiveX.
推荐答案
Google正在Google+中执行此操作,并且一位才华横溢的开发人员对其进行了逆向工程并制作了 http:// html2canvas。 hertzen.com/ 。要在IE中工作,您需要一个画布支持库,例如 http://excanvas.sourceforge.net/
Google is doing this in Google+ and a talented developer reverse engineered it and produced http://html2canvas.hertzen.com/ . To work in IE you'll need a canvas support library such as http://excanvas.sourceforge.net/
这篇关于JavaScript代码,无需使用ActiveX即可获取网站的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!