<script> function s(){ // this is the method by ActiveXObject var obj = new ActiveXObject("prjTest.testCtrl"); if (obj) { var a = obj.JustForTest(); alert(a); } } </script> <body > <OBJECT id="objTest" CLASSID="clsid:B1083D3F-A314-4DC9-9F67-107A1C0D6907"> <SPAN STYLE="color:red">ActiveX 控件装入失败! -- 请检查浏览器的安全设置。</SPAN> </OBJECT> <input type="button" onclick="alert(objTest.JustForTest())" value="Click Me"> </body>
也就是说 obj.JustForTest();的返回值没有得到,我也搞不懂是为什么,
望高手指教
我选择的工程类型是activeX DLLvb代码Public Function JustForTest()
JustForTest = "test"
End Function
用这个
<object></object>
用这个
---------------------------------------能否讲的详细点。
function s(){
// this is the method by ActiveXObject
var obj = new ActiveXObject("prjTest.testCtrl");
if (obj)
{
var a = obj.JustForTest();
alert(a);
}
}
</script>
<body >
<OBJECT id="objTest" CLASSID="clsid:B1083D3F-A314-4DC9-9F67-107A1C0D6907">
<SPAN STYLE="color:red">ActiveX 控件装入失败!
-- 请检查浏览器的安全设置。</SPAN>
</OBJECT>
<input type="button" onclick="alert(objTest.JustForTest())" value="Click Me">
</body>