From VB6 code - run Javascript function in WebBrowser control

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Can this be done? Can VB6 code execute a javascript function in a loaded page
of a webbrowser control?

I have a VB6 project with a WebBrowser control on it with this page loaded.

--------------------------------------
<html>
<body>
<script>
function showalert(){
alert("Hello World");
}
</script>
<p>my web page</p>
<input type="button" onclick="showalert()" value="Click for Hello World">
</body>
</html>
--------------------------------------

In a cmdButton_Click() event I'd like to call the javascript function
showalert().


Thanks
Ken


.


Quantcast