Asynchronous Javascript event

Hello friends,

I am using the TMSWebBrowser component and I need to capture the browser url when I move through a map in google maps, I use for this the Javascript code execution as you recommend.

TMSWebBrowser.ExecuteJavascript('window.location.href',
procedure( const AValue: string)
begin
TTMSFNCUtils.Log(AValue);
GlobalString := Avalue;
end );

How can I capture Avalue in GlobalString, since the assignment seems to occur asynchronously, and GlobalString does not contain any assignment data right after the end of procedure( const AValue: string).
Best regards, Silvestre

Please use ExecuteJavaScriptSync instead to capture the URL synchronously.

Thank you very much, this works correctly, I had overlooked it.