I am trying to open a print dialog box in Opera browser using javascript.
The print() is working fine in all browsers but in opera it doesn\'t work.
My p
I think there are two things happening here:
As others have pointed out, Opera requires that window.print() be triggered by an event: a click or a load event, for example. In general, you'll need to wrap window.print() in an event listener. Try window.addEventListener('load', function(e) { window.print(); }, false); or window.onload = function(){ window.print() }
It looks like Opera also only allows a limited subset of window methods on windows that are opened via JavaScript. print() doesn't appear to be one of the methods allowed.