how to print contents of specific div at html?

function printdiv(id)
{

try{
var x = ”;
x = document.getElementById(id).innerHTML;
//alert(x);
newwindow2=window.open(”,’name’,’scrollbars=yes,resizable=yes,height=500,width=500,toolbar=1′);
newwindow2.title = “The new title goes here.”;
var tmp = newwindow2.document;
tmp.write(x);
newwindow2.print();
tmp.close();
newwindow2.close();
}catch(err){}

}

Advertisements

About lorddisk

WebCenter Content, WebCenter Portal, WebCenter Sites,Weblogic, Identity and Access Management (IAM),SSO,OAM,OIM,OAAM,OUD, OPAM,OID, OVD ,Oracle API Gateway ,OBIEE,OEDQ, Oracle ADF, Oracle SOA,J2EE, CackePHP ,PHP,J2SE,J2EE,Spring,Hibernate,JQuery,CSS,Java Script ,Joomla,Drupal,Worpress
This entry was posted in java Script. Bookmark the permalink.