我在自己程序中导入 smsx.cab文件后 代码如下: <html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页 </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<!-- MeadCo Security Manager -->
<object viewastext style="display:none" classid="clsid:5445be81-b796-11d2-b931-002018654e2e" codebase="smsx.cab#Version=6,3,435,20">
<param name="GUID" value="{232E61C9-1E90-4657-AEDB-6F02F3B2EE37}"/>
<!-- <param name="Path" value="sxlic.mlf"/>-->
<param name="Revision" value="0"/>
<param name="template" value="MeadCo://IE7" />
</object> <!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>
<script defer>
function SetPrintSettings()
{ // -- advanced features
factory.printing.SetMarginMeasure(2);
// measure margins in inches
factory.printing.printer = "HP DeskJet 870C";
factory.printing.paperSize = "A4";
factory.printing.paperSource = "Manual feed";
factory.printing.collate = true;
factory.printing.copies = 2;
factory.printing.SetPageRange(false, 1, 3);
// need pages from 1 to 3 // -- basic features
factory.printing.header = "This is MeadCo";
factory.printing.footer = "Advanced Printing by ScriptX";
factory.printing.portrait = false;
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
}
function Print(frame)
{
factory.printing.Print(true, frame)
// print with prompt
}
</script>
<input type="button" id="b1" value="打印本页" onclick="javascript:document.all.factory.printing.Print(false);"/>
<input type="button" id="b2" value="页面设置" onclick="javascript:document.all.factory.printing.PageSetup();"/>
<input type="button" id="b3" value="打印预览" onclick="javascript:document.all.factory.printing.Preview();"/>
</div>
</form>
</body>
</html> 在自己电脑IE7上访问没问题,可是在其他电脑 IE7 上访问javascript就会提示 document.all.factory.printing 为空或不是对象!!
怎么办~~~怎么回事~~~ 谢谢`?
<head runat="server">
<title>无标题页 </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<!-- MeadCo Security Manager -->
<object viewastext style="display:none" classid="clsid:5445be81-b796-11d2-b931-002018654e2e" codebase="smsx.cab#Version=6,3,435,20">
<param name="GUID" value="{232E61C9-1E90-4657-AEDB-6F02F3B2EE37}"/>
<!-- <param name="Path" value="sxlic.mlf"/>-->
<param name="Revision" value="0"/>
<param name="template" value="MeadCo://IE7" />
</object> <!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>
<script defer>
function SetPrintSettings()
{ // -- advanced features
factory.printing.SetMarginMeasure(2);
// measure margins in inches
factory.printing.printer = "HP DeskJet 870C";
factory.printing.paperSize = "A4";
factory.printing.paperSource = "Manual feed";
factory.printing.collate = true;
factory.printing.copies = 2;
factory.printing.SetPageRange(false, 1, 3);
// need pages from 1 to 3 // -- basic features
factory.printing.header = "This is MeadCo";
factory.printing.footer = "Advanced Printing by ScriptX";
factory.printing.portrait = false;
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
}
function Print(frame)
{
factory.printing.Print(true, frame)
// print with prompt
}
</script>
<input type="button" id="b1" value="打印本页" onclick="javascript:document.all.factory.printing.Print(false);"/>
<input type="button" id="b2" value="页面设置" onclick="javascript:document.all.factory.printing.PageSetup();"/>
<input type="button" id="b3" value="打印预览" onclick="javascript:document.all.factory.printing.Preview();"/>
</div>
</form>
</body>
</html> 在自己电脑IE7上访问没问题,可是在其他电脑 IE7 上访问javascript就会提示 document.all.factory.printing 为空或不是对象!!
怎么办~~~怎么回事~~~ 谢谢`?
在自己电脑IE7上访问没问题,可是在其他电脑 IE7 上访问javascript就会提示 document.all.factory.printing 为空或
不是对象!! ----------------------------------------
看看这两句,你也知道是本地导入了 smsx.cab 这个打印控件是需要安装客户端的,如果你的客户端没有安装就会提示这个错误,下载打印这个控件的时候对应应该还有一个 smsx.exe 文件,这个是给客户端单独安装的,如果你的服务器上有这个文件,那么这个控件呈现的时候IE自动提示客户端安装
可以做个bat文件连同三个dll放到一个文件夹下,然后运行一下bat就可以了。附bat文件内容格式如下:regsvr32 MCPrintX.dll
regsvr32 MCPrintXU.dll
regsvr32 MCScripX.dll