<script language="javascript">
function doPrint(){
var str="<html>/n<meta http-equiv='content-type' content='text/html; charset=big5'>";
var article;
str +='<meta http-equiv="content-type" content="text/html; charset=gb2312">';
str +="<body bgcolor=#ffffff topmargin=5 leftmargin=5 marginheight=5 marginwidth=5 onLoad='window.print();window.close();'>";
article=document.all.article.innerHTML;
//alert(article);
str +=article;
str +="</body></html>";
var p = window.open("","print");
p.document.write(str);
p.document.close();
}
</script>
<div id="article" name="article">
要打印的内容
</div>
<a href="#" onClick="javascript:doPrint();" class="buttonlink">Print</a>