我用delphi的activex生成了一个ocx,在delphi里运行测试都是好好的。我在asp网页中直接加入<OBJECT
classid="clsid:D1354384-2C30-4854-97B0-B98CEE14131F"
codebase="http://QPJWEB/qpj/hcxjzbActiveFormProj1.ocx#version=1,0,88,0"
width=519
height=362
align=center
hspace=0
vspace=0
>
</OBJECT>
结果发现好像不对,因为出来的运行起来有的都不一样了,我想问问大家这是如何回事呢?你们嵌入网页的时候都是如何写代码的呢?
classid="clsid:D1354384-2C30-4854-97B0-B98CEE14131F"
codebase="http://QPJWEB/qpj/hcxjzbActiveFormProj1.ocx#version=1,0,88,0"
width=519
height=362
align=center
hspace=0
vspace=0
>
</OBJECT>
结果发现好像不对,因为出来的运行起来有的都不一样了,我想问问大家这是如何回事呢?你们嵌入网页的时候都是如何写代码的呢?
function insertocx(elm)
{
var str = '';
str += '<object height="620" classid="clsid:8E55EAA3-342E-4931-B526-688AD9BD6659" VIEWASTEXT>'
str += '<PARAM NAME="Visible" VALUE="0">'
str += '<PARAM NAME="AutoScroll" VALUE="0">'
str += '<PARAM NAME="AutoSize" VALUE="0">'
str += '<PARAM NAME="AxBorderStyle" VALUE="1">'
str += '<PARAM NAME="Caption" VALUE="synjonPic">'
str += '<PARAM NAME="Color" VALUE="16711422">'
str += '<PARAM NAME="Font" VALUE="MS Sans Serif">'
str += '<PARAM NAME="KeyPreview" VALUE="0">'
str += '<PARAM NAME="PixelsPerInch" VALUE="96">'
str += '<PARAM NAME="PrintScale" VALUE="1">'
str += '<PARAM NAME="Scaled" VALUE="-1">'
str += '<PARAM NAME="DropTarget" VALUE="0">'
str += '<PARAM NAME="HelpFile" VALUE="">'
str += '<PARAM NAME="ScreenSnap" VALUE="0">'
str += '<PARAM NAME="SnapBuffer" VALUE="10">'
str += '<PARAM NAME="DoubleBuffered" VALUE="0">'
str += '<PARAM NAME="Enabled" VALUE="-1">'
document.getElementById(elm).innerHTML = str;
}
--调用
<script type="text/javascript">
insertfilterocx('pic1');
</script>
在asp.net中调用的时候是这样
<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
<form id="Form1">
<div id="pic1"><FONT face="宋体"> </FONT>
<script type="text/javascript">
insertfilterocx('pic1');
</script>
</div>
</form>
</body>
<form id="Form1">
<div id="pic1"><FONT face="宋体"> </FONT>
<script type="text/javascript">
insertocx('pic1');
</script>
</div>
</form>
</body>
<HEAD>
<title>****</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD><BODY leftmargin="0" topmargin="0"><OBJECT id = "***"
classid="clsid:45648791-BB13-4B15-A3AC-610861D519EA"
codebase="http://192.168.0.209/****.inf"
width="100%"
height="100%"
align=center
hspace=0
vspace=0
>
</OBJECT>
<script type="text/javascript">
PMSX.Update();
PMSX.Run();
</script></BODY>
</HTML>