create screenshot of webpage using html2canvas (unable to initialize properly)

后端 未结 5 2198
醉酒成梦
醉酒成梦 2020-12-01 06:03

I am attempting to use http://html2canvas.hertzen.com/ to take screenshots of my webpage. I am unable to initialize a canvas element using...

var canvas = $         


        
5条回答
  •  没有蜡笔的小新
    2020-12-01 06:22

    You could also use the following:

    var html2obj = html2canvas($('body'));
    
    var queue  = html2obj.parse();
    var canvas = html2obj.render(queue);
    var img = canvas.toDataURL();
    
    window.open(img);
    

提交回复
热议问题