Page 1 of 1

javascript talk to livecode through browser

Posted: Thu May 05, 2016 4:49 pm
by rblackmore245
Is is possible to pass data from JavaScript to livecode from webpage running in the browser within livecode ?

Re: javascript talk to livecode through browser

Posted: Mon May 09, 2016 10:44 am
by rblackmore245
After searching for days I found the answer :o/ hidden away in the internet TUT!.

For anyone else who has this problem its:

put revBrowserOpenCef(the windowId of this stack, "c:\test.html") into tBrowserID
revBrowserSet tBrowserID, "rect", the rect of graphic "browserPlaceholder"
revBrowserAddJavaScriptHandler tBrowserID, "browserButtonClick" ---- This line here that is the answer sets up livecode to listen for javascript calls



------------------------------

~Then in your HTML page this function will send the data to livecode


function test() {
liveCode.browserButtonClick("Hello, world!");
}

Re: javascript talk to livecode through browser

Posted: Mon Jun 06, 2016 10:33 am
by lilRalph
Or you could have a look at the code samples and stacks here

http://forums.livecode.com/viewtopic.php?f=11&t=25307

Cheers.