DelphiFAQ Home Search:

Calling a Delphi procedure from Javascript


comments6 comments. Current rating: 2 stars (2 votes). Leave comments and/ or rate it.


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?


Well you can only extend window.external

To do this easily, first stop using TWebBrowser and get TEmbeddedWB which can be found at

Then read this

Content-type: text/html


2006-09-21, 16:40:13
anonymous from Bulgaria  
Answer would be more useful if it was about how to call Delphi code from javascript function when using TWebBrowser ( that is what the question was for ).
2007-10-30, 16:49:38
You can supply your own (COM) interface (and it's implementation) and attach it to the TWebbrowser control, and make calls to that interface from javascript. Some googling will provide you good examples!
2007-10-30, 16:54:23
2009-01-21, 16:00:45
anonymous from Colombia  
2011-12-22, 05:20:48
Broken links...
2017-07-17, 15:46:29
Marissa from Monterrey, Mexico  
I must say you have high quality posts here.

Your posts should go viral. You need initial traffic only.

How to get massive traffic? Search for: Murgrabia's tools go viral



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: