我使用Html2Canvas.js将div转换为画布
var canvasimage="";
html2canvas($("#dvorder"), {
onrendered: function (canvas) {
theCanvas = canvas;
$('#imgDemo').append(canvas);
$('#imgDemo canvas').attr('id', 'Billcan');
canvasimage = document.getElementById('Billcan').toDataURL("image/png");
}
});
如何在html2Canvas之外获取变量canvasimage的值 请参考jsfiddle: http://jsfiddle.net/8ypxW/3/