日期:2014-05-18  浏览次数:20662 次

jsp中如何调用我的js(一个打印教本).请高手指教.
jsp中如何调用我的js(一个打印教本).请高手指教.
我的js教本:
<object   id= "factory "   style= "display:none "   viewastext  
    classid= "clsid:1663ed61-23eb-11d2-b92f-008048fdd814 "  
    codebase= "http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360 "  
> </object>  
<input   type=button   value=页面设置   onclick= "factory.printing.PageSetup() ">  
<input   type=button   value=打印预览   onclick= "factory.printing.Preview() ">  
   
<script   language=javascript>  
function   window.onload()  
{  
      //   --   advanced   features  
      factory.printing.SetMarginMeasure(2)   //   measure   margins   in   inches  
      factory.printing.SetPageRange(false,   1,   3)   //   need   pages   from   1   to   3  
      factory.printing.printer   =   "HP   DeskJet   870C "  
      factory.printing.copies   =   2  
      factory.printing.collate   =   true  
      factory.printing.paperSize   =   "A4 "  
      factory.printing.paperSource   =   "Manual   feed "  
      //   --   basic   features  
      factory.printing.header   =   "居左显示&b居中显示&b居右显示页码,第&p页/共&P页 "  
      factory.printing.footer   =   "(自定义页脚) "  
      factory.printing.portrait   =   false  
      factory.printing.leftMargin   =   0.75  
      factory.printing.topMargin   =   1.5  
      factory.printing.rightMargin   =   0.75  
      factory.printing.bottomMargin   =   1.5  
}  
function   Print(frame)   {  
    factory.printing.Print(true,   frame)   //   print   with   prompt  
}  
</script>  
<input   type=button   value= "打印本页 "   onclick= "factory.printing.Print(false) ">  
<input   type=button   value= "页面设置 "   onclick= "factory.printing.PageSetup() ">  
<input   type=button   value= "打印预览 "   onclick= "factory.printing.Preview() "> <br>  
在jsp文件中怎么调用这个js文件?

------解决方案--------------------