خرید بک لینک

Vote count: 0

I want to print the content of the iframe. I viewd several examples but non of them helped me for my case. I have the following piece of code

<div id="print-area">
    <iframe src='data:text/html;charset=utf-8,<?php echo $content ?>'></iframe>
</div>

And when the #print button is clicked: (this code prints out the content of the div #print-area)

$("#print").click(function (e) {
        var newWindow = window.open();
        newWindow.document.write($('#print-area').html());
        newWindow.print()
    });

The code works and print window is prompted, but when I try to put content of the iframe in the document.write(...) the function does not work. Any idea?

tried solutions:

Print iFrame content using Javascript

How to Print iframe content

and from other topics, but did not manage to print my iframe content

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 27 فروردين 1395 ساعت: 18:40

صفحه بندی