在页面里用代码怎么实现。不想在IE里设置
期待高手指导。
谢谢

解决方案 »

  1.   

    var param = "中文";
    var url   = "url.aspx?param=" + escape(param);
      

  2.   

    <SCRIPT language="VBScript"> 
    dim hkey_root,hkey_path,hkey_key 
    hkey_root="HKEY_CURRENT_USER" 
    hkey_path="\Software\Microsoft\Internet Explorer\PageSetup" 
    '//设置网页打印的页眉页脚为空 
    function pagesetup_null() 
    on error resume next 
    Set RegWsh = CreateObject("WScript.Shell") 
    hkey_key="\header" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
    hkey_key="\footer" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
    hkey_key="\margin_bottom" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" //控制"纵打"、 横打”和“页面的边距。 
    hkey_key="\margin_left" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    hkey_key="\margin_right" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    hkey_key="\margin_top" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    end function 
    </SCRIPT><BODY leftMargin="0" topMargin="0" onload="pagesetup_null()" rightMargin="0" ms_positioning="GridLayout">这个是可以的
      

  3.   

    不过要在ie中的"internet选项"中的"安全"里启用"activeX"
      

  4.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <SCRIPT language="VBScript"> 
    dim hkey_root,hkey_path,hkey_key 
    hkey_root="HKEY_CURRENT_USER" 
    hkey_path="\Software\Microsoft\Internet Explorer\PageSetup" 
     
    function pagesetup_null() 
    on error resume next 
    Set RegWsh = CreateObject("WScript.Shell") 
    hkey_key="\header" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
    hkey_key="\footer" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" 
    hkey_key="\margin_bottom" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" //控制"纵打"、 横打”和“页面的边距。 
    hkey_key="\margin_left" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    hkey_key="\margin_right" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    hkey_key="\margin_top" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.75" 
    end function 
    </SCRIPT>
    </head><body onload="pagesetup_null()">
    <p>测试打印</p>
    <p>测试打印 </p>
    <p>测试打印测试打印测试打印</p>
    <p>&nbsp;</p>
    <p>
      <input type="button" name="Submit" value="打印" onclick="JavaScript:window.print();" />
      <input type="button" name="Submit2" value="打印设置" onclick="JavaScript:window.focus();WebBrowser1.ExecWB(8,1);" />
      <OBJECT id="WebBrowser1" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" VIEWASTEXT>
    </OBJECT>
    </p>
    </body>
    </html>
      

  5.   

    http://www.wave12.com/web/SigCon.asp?bCate=50&sCateName=%B9%A6%C4%DC%BD%E9%C9%DC&ID=173&CateName=wsReport4.5