I am trying to add a print button inside the window thats created by js.
But its showing [object Window] instead of showing the link or button. What is an alternative solution?
jQuery(function($) {
$('a.print').click(function(){
var print_button = '<a href="javascript:window.print();" class="print">Print</a>';
var print_page = window.open('','Print','width=600,scrollbars=yes, height=700');
var html = print_page + '<h2><?php print t("Term & Condition"); ?></h2> <br/>' + 'somethings';
print_page.document.open();
print_page.document.write(html);
print_page.document.close();
return false;
});
});
If I got your question right,
Pass the div name that’s is to be printed. There are a lot of jquery plugins which will allow you to help you out. Try googling.
If I’m mistaken your question correct me, I might be able to help you out.