Unicode and revBrowser: "selected" property and callback messages

Todd Geist todd at geistinteractive.com
Sun May 29 18:32:43 EDT 2011


>
> 1) can a JavaScript function in the Web page that is displayed by
> revBrowser
> send a message back to the stack, and pass a parameter with that message?
> Something like onmouseclick="CallMotherStack(myValueStr)"?
>


Yes it can!

This is something I have been messing with lately. I have a proof of concept
working. Its pretty cool and I think it opens the door for a new kind of
hybrid HTML/LiveCode app.

Here is what I do.  I start up an HTTP server in my stack.

revHTTP is full http server that takes about 450 lines of xTalk.  You can
get from Andre's web site.

Once I have revHTTP server running along side my revBrowser, I can use
standard HTML / Javascript to exchange data back and forth between the
embedded browser and my stack.

I can serve pages from my Stack to the browser. I can send AJAX requests to
my stack and the stack can respond with XML or JSON.  From the embedded
browser I can call any handler in any stack that is in memory.

revHTTP is single threaded and blocking. It would probably have difficulty
handling a busy web site. But I am only using it for one user at a time, so
it should be fine.

I haven't subjected this to rigorous testing, I just have the proof working.
 But so far it seems to work pretty well.

If I can get it a bit further I will post the code

Todd

Todd Geist
------------------------------
geist interactive <http://www.geistinteractive.com>
805-419-9382



More information about the use-livecode mailing list