در حالت عادی میتونیم با استفاده از کد زیر از صفحه فعلی پرینت بگیریم:
اما اگه بخوایم فقط محتوای یک IFrame رو پرینت بگیریم میتونیم از کد زیر استفاده کنیم:
window.print();
اما اگه بخوایم فقط محتوای یک IFrame رو پرینت بگیریم میتونیم از کد زیر استفاده کنیم:
<script>
function iPrint(ptarget) {
ptarget.focus();
ptarget.print();
}
</script>
<body>
<iframe name="theIFrame" id="theIFrame" width="500" height="200" src="some.file"></iframe>
<input type="button" value="Print IFRAME" onclick="iPrint(theIFrame);" />
</body>







0 نظر:
ارسال یک نظر