Lionheart2010
asked on
call / run / execute a javascript function on a html webpage with an vb 6 activeX on the same page
I've made a small vb6 activex control which resides on a webpage.
The webpage also got a Javascript.
What code in the VB6 activex component is needed to call / execute the
HelloWorld Javascript below?
Sample code:
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function hello()
{
alert ("Hello world");
}
//-->
</SCRIPT>
</head>
<BODY>
<OBJECT id="myvbcomp" name="test1" classid="clsid:758D9CAB-04 FE-49BF-AD 81-886234C 88189"> </OBJECT>
<A HREF="JavaScript:hello()"> Hellolink on webpage</A>
</BODY>
</HTML>
/ Thanks
The webpage also got a Javascript.
What code in the VB6 activex component is needed to call / execute the
HelloWorld Javascript below?
Sample code:
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function hello()
{
alert ("Hello world");
}
//-->
</SCRIPT>
</head>
<BODY>
<OBJECT id="myvbcomp" name="test1" classid="clsid:758D9CAB-04
<A HREF="JavaScript:hello()">
</BODY>
</HTML>
/ Thanks
ASKER
Your suggestion only adds a button to the webpage.
My question is how I call / run / execute / start / activate the Javascript function FROM the Visual Basic Component on the same page ( the <Object> )
I can put a button on the VB6 component, but it must be Visual Basic code to, not HTML.
Any more ideas?
/ Richard
My question is how I call / run / execute / start / activate the Javascript function FROM the Visual Basic Component on the same page ( the <Object> )
I can put a button on the VB6 component, but it must be Visual Basic code to, not HTML.
Any more ideas?
/ Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Manage to solve it with help from another question:
https://www.experts-exchange.com/questions/25014083/activex-Modify-a-textbox-value-in-a-form-on-a-webpage-which-also-has-the-activex-vb6.html
https://www.experts-exchange.com/questions/25014083/activex-Modify-a-textbox-value-in-a-form-on-a-webpage-which-also-has-the-activex-vb6.html
ASKER
Niversoft's suggestion on my other question solved this issue as well. THANKS!
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function hello()
{
alert ("Hello world");
}
//-->
</SCRIPT>
</head>
<BODY>
<OBJECT id="myvbcomp" name="test1" classid="clsid:758D9CAB-04
<A HREF="JavaScript:hello()">
<input id="Button1" type="button" value="button" onclick="return hello()" />
</BODY>
</HTML>
surely it works..