<script language="Javascript">
function preview()
{
var prnhtml=null;
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";//开始标识
eprnstr="<!--endprint-->";//结束标识
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); //截取标识之间部分打印
FGFG=window.document.body.innerHTML
window.document.body.innerHTML=prnhtml;
window.print();
window.document.body.innerHTML=FGFG //如果不加此行,没有打印的部分在页面上会隐藏掉
}
</script>