xojo desktop app / htmlViewer / javascript

Hello,
I am evaluating xojo for my next project.
Most of the UI will be built in javascript and loaded in a HtmlViewer.
I see this works fine and i can call javascript functions using .ExecuteJavaScript(). But i need the other way too, to call xojo functions form my javascript code.
In VB.net I can do that using “window.external.function”.
Is it posible to do the same in xojo?

Thnk you.

[quote=235152:@Daniel Ghervas]Hello,
I am evaluating xojo for my next project.
Most of the UI will be built in javascript and loaded in a HtmlViewer.
I see this works fine and i can call javascript functions using .ExecuteJavaScript(). But i need the other way too, to call xojo functions form my javascript code.
In VB.net I can do that using “window.external.function”.
Is it posible to do the same in xojo?[/quote]

HTMLViewer does not have that. To return variables, one can use the statuschanged or titlechanged events. The same technique can be used to return for instance “Exe parameters”.

I will try to work with that. Thnk you Mchel.

I personally use the CancelLoad function, and grab URLs with a special header, but then I’m not doing terribly complicated functions with HTML in a Xojo application.

Yes. I posted that method a while ago. It works fine cross platform. So does titlechanged. On Mac, StatusChanged works fine, and there is a declare. Would be nice if Xojo added a method to HTMLViewer, though.

Those that haven’t should sign on to the feedback://showreport?report_id=34768

Hello ,
I have the same question, I need to call a xojo function from javascript
how StatusChanged works ?
I readed the documentation but it is not very helpful for me
is there an example ?

Thanks

Check https://forum.xojo.com/22633-get-javascript-variables-back-from-htmlviewer-without-changing-/0

Thank you Michel Bujardet

I’m trying to understand how to make it work
actually also many Demo examples doesn’t work I don’t know way
my system is MacOSX El Capitan

demo like Sample Application /Sample Browser and tab web browser
doesen’t connect However they don’t give me any errors
I also tried Xojo 2015 r4 but the problem is the same

P.S. i need to create a OSX Desk application not web Application

Using JavaScript within a HTML Viewer requires an intimate knowledge of both Xojo and JavaScript.

You may want to start by reading the manual for Xojo there is also a PDF version in the Documentation folder within your install. Once you understand how Xojo events work you’ll be able to use the workarounds we’ve posted here.