Html generates data and prints from another page
In the code below
in a.html there is this code like,
<div id="tableview"></div>//Data loaded dynamically
<input type="button" id="printbtn" onclick="print()"/>
<script>
function print()
{
var data=$('#tableview').html();
dataobj.print();
}
In b.html
I need to print a.html without opening it, but not opening it, how the data will be generated in the div, and how to print only this data from b.html
Thank..
Update: this answer assumes that after your question there should not be a postback. (No ajax)
If you have only one view per page, you can apply the media = print filter to the page. First load both views and show the on-screen window.
<Style href="print.css" media="print" />
prinatble:
* {
visibility: hidden;
}
#tableview * {
visibility: visible;
}