JS实现控制打印BS结构程序中简单票据页面
<body style="background-color:white" >
<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
width="0">
</object>
<span id="timer"></span><br>
<script language="javascript" type="text/javascript">
document.getElementById("timer").innerHTML=new Date().toLocaleString();
</script>
<table cellpadding=5 class="grid_block" id="myTable">
<td {$JE_style}>
<input type="text" name="ftotal" size=8 readonly value=‘{$JE_value}‘>
</td>
<script type="text/javascript" >
setTimeout("window.close();",2000);//5秒后关闭页面
</script>
合计:<b id="znum">
</b>.00元
{$footer}
<script type="text/javascript" >
var getTd=document.getElementById("myTable");
rowsLength=getTd.rows.length;
var znum= document.getElementById("znum");
var newzum=0 ;
for(var j=0;j<rowsLength-1;j++)
{
//var price = (12345.99).formatMoney();
//priceVal = parseFloat(price.replace(/[^0-9-.]/g, ‘‘)); // 12345.99
newzum+=parseFloat(document.getElementsByName("ftotal")[j].value.replace(/[^0-9-.]/g, ‘‘));
}
znum.innerHTML =newzum;
//alert(document.getElementsByName("ftotal")[0].value);
</script>