window.print not working with opera browser

给你一囗甜甜゛ 提交于 2019-12-02 04:21:59

Try putting your code in load event:

<script language=javascript>
window.onload = function(){
  window.print();
};
</script>

You need to make sure the whole web page is loaded in Opera before you call window.print();

So using this may help - not, I am waiting for the page to load AND causing a slight delay, which is a little known fix for some versions of Opera.

Hope it helps.

window.onload = function () {
    window.setTimeout(function () {
        window.print();
    }, 500);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!