Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 897
  • Last Modified:

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-04FE-49BF-AD81-886234C88189"> </OBJECT>

<A HREF="JavaScript:hello()">Hellolink on webpage</A>

</BODY>
</HTML>

/ Thanks
0
Lionheart2010
Asked:
Lionheart2010
  • 3
1 Solution
 
Maheshwar RSoftware DeveloperCommented:
put a button and assign an onclick event.. or Try the following code..


<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function hello()
{
alert ("Hello world");
}
//-->
</SCRIPT>
</head>

<BODY>
<OBJECT id="myvbcomp" name="test1" classid="clsid:758D9CAB-04FE-49BF-AD81-886234C88189"> </OBJECT>

<A HREF="JavaScript:hello()">Hellolink on webpage</A>
<input id="Button1" type="button" value="button" onclick="return hello()" />
</BODY>
</HTML>

surely it works..
0
 
Lionheart2010Author Commented:
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
0
 
Lionheart2010Author Commented:
0
 
Lionheart2010Author Commented:
Niversoft's suggestion on my other question solved this issue as well. THANKS!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now