您的位置:程序门 -> delphi -> 网络通信/分布式开发



【请教】activex如何调用网页中的javascript函数?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


【请教】activex如何调用网页中的javascript函数?[无满意答案结贴,结贴人:lou_nj]
发表于:2007-11-20 16:01:26 楼主
activex如何调用网页中的javascript函数?
请指教,万分感谢!
发表于:2007-11-21 12:56:001楼 得分:0
问题解决了:
<html>
<h1>   测试activex与javascript的交互   </h1> <p> <hr>
<center>
点击按钮copytohtml可以把activex中的文本内容拷贝到html中.
<p>
<object
                    id=testax  
    classid="clsid:8001e397-52a3-485e-a32c-a3a2623273da"
    codebase="http://lsy/ff/activeformproj1.ocx#version=1,0,2,0"
    width=360
    height=159
    align=center
    hspace=0
    vspace=0
>
</object>
<hr>
<br>
点击按钮copytoax可以把html中的文本内容拷贝到activex中.

<br> <input   type="text"   name="txttest"   size="50"> <br>
<input   type="button"   value="copytoax"   name="b3"   onclick="myclick()">
<hr>
</body>

<script   language="javascript">
<!--
function   myclick()   {
    document.all.testax.mystr   =   document.all["txttest"].value   ;
}
//-->
</script>

<script   language="javascript"   for=testax   event=onclick>
          txttest.value   =   testax.mystr   ;
</script>
</html>
发表于:2007-11-21 12:57:322楼 得分:0
问题解决了:
问题解决了:
<html>
<h1>   测试activex与javascript的交互   </h1> <p> <hr>
<center>
点击按钮copytohtml可以把activex中的文本内容拷贝到html中.
<p>
<object
                    id=testax  
    classid="clsid:8001e397-52a3-485e-a32c-a3a2623273da"
    codebase="http://lsy/ff/activeformproj1.ocx#version=1,0,2,0"
    width=360
    height=159
    align=center
    hspace=0
    vspace=0
>
</object>
<hr>
<br>
点击按钮copytoax可以把html中的文本内容拷贝到activex中.

<br> <input   type="text"   name="txttest"   size="50"> <br>
<input   type="button"   value="copytoax"   name="b3"   onclick="myclick()">
<hr>
</body>

<script   language="javascript">
<!--
function   myclick()   {
    document.all.testax.mystr   =   document.all["txttest"].value   ;
}
//-->
</script>

<script   language="javascript"   for=testax   event=onclick>
          txttest.value   =   testax.mystr   ;
</script>
</html>


快速检索

最新资讯
热门点击