Need sample code of using ExecuteScript and InvokeScript
Hi,
Can you please give a sample code of using ExecuteScript and InvokeScript.
I want to print the content of the DIV; I am using ExecuteScript (containing the following javascript code) on the webpage but it is not working.
function printDiv()
{
var content = document.getElementById('ctl00_MainContentPlaceHolder_panelFrame').innerHTML;
var mywindow = window.open('', 'Print', 'height=600,width=800');
mywindow.document.write('<html><head><title>Print</title>');
mywindow.document.write('</head><body >');
mywindow.document.write(content);
mywindow.document.write('</body></html>');
mywindow.document.close();
mywindow.focus()
mywindow.print();
mywindow.close();
return true;
}
***Updated by moderator: Lochan to branch reply and create new post***