Strings Delphi

Question:
In a TWebBrowser, I display a webpage with a javascript function, and i need to call Delphi code from that javascript function. How can I achieve that?
Answer:
Well you can only extend window.external
To do this easily, first stop using TWebBrowser and get TEmbeddedWB which can be found at http://www.euromind.com/iedelphi/embeddedwb.htm.
Then read this http://www.euromind.com/iedelphi/embeddedwb/ongetexternal.htm.