當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
html怎么快速打出来的,javascript – 快速打印HTML5画布
生活随笔
收集整理的這篇文章主要介紹了
html怎么快速打出来的,javascript – 快速打印HTML5画布
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
我搜索了很多,找到了一個完美的解決方案:)
使用onclick事件
function printCanvas()
{
var dataUrl = document.getElementById('anycanvas').toDataURL(); //attempt to save base64 string to server using this var
var windowContent = '';
windowContent += ''
windowContent += '
Print canvas';windowContent += '
'windowContent += '';
windowContent += '';
windowContent += '';
var printWin = window.open('','','width=340,height=260');
printWin.document.open();
printWin.document.write(windowContent);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
總結(jié)
以上是生活随笔為你收集整理的html怎么快速打出来的,javascript – 快速打印HTML5画布的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 不良征信5年后会清零吗?
- 下一篇: gradle idea java ssm