1. 引进jquery.js 2. 引进html2canvas.min.js或html2canvas.js 3.选择要截屏的内容(比如容器.container-box里面的内容) html2canvas($(".container-box"),{ allowTaint:true, tainTest:true, scale: 1, onrendered: function(canvas) { //imgUrl即是图片的地址 var imgUrl = canvas.toDataURL(); } })