Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jul : TWebBrowser Dilemas

www.cryer.info
Managed Newsgroup Archive

TWebBrowser Dilemas

Subject:TWebBrowser Dilemas
Posted by:"Anthoni Gardner" (nono..@nono.com)
Date:Sat, 1 Jul 2006 21:06:17

Hello there,

Not sure if this is the right group to post in, so appologies if it isnt.

I have a TWebBrowser on my form and I have created a com object that gets
passed to it in the GetExternal(out ppDispatch: IDispatch): HRESULT; event

I am using this to respond to certain things are going on inside the html
itself, like retrieving text box information, button clicks etc.

Now this works fine when the underlying code of the webbrowser is vbscript,
but it doesnt work when the script language is javascript.

Using the OnGetExternal demo from the TEmbeddedWB website, I have javascript
like

<SCRIPT language=javascript>
   function getname(){
    AppString.InnerText = external.Getname;
   }
  </SCRIPT>

And html code of
<B>Lets test getting variables from our parent application</B><BR>
Name: <SPAN ID="AppString"></SPAN><BUTTON
onclick="getname()">Update</BUTTON><BR>

Now when I click the button, it is supposed to fill the Span with the name
of text box on the delphi host form, but it doesnt. This works fine

<script language=vbscript>
sub getname()
    AppString.InnerText = Window.External.Getname
end sub
</script>
<B>Lets test getting variables from our parent application</B><BR>
Name: <SPAN ID="AppString"></SPAN><BUTTON
onclick="getname()">Update</BUTTON><BR>

Any suggestions to how to get the javascript side of things working as well?
Some of my users wish to use Javascript and not vbscript.

Regards
Anthoni

Replies:

www.cryer.info
Managed Newsgroup Archive