This code is working fine in Chrome but not in Firefox. It gives a error :
SecurityError: Permission denied to access property "print" on cross-origin object"
Please give me a solution.
<iframe src="myfile.pdf" style="width: 96%; height:500px;" frameborder="0" id="iframe" name="iframe"></iframe>
<button type="button" class="btn btn-default" onclick="print()">Print</button>
function print() {
jQuery("#iframe").get(0).contentWindow.print();
}