javascript talk to livecode through browser
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
javascript talk to livecode through browser
Is is possible to pass data from JavaScript to livecode from webpage running in the browser within livecode ?
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Re: javascript talk to livecode through browser
After searching for days I found the answer / 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!");
}
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
Or you could have a look at the code samples and stacks here
http://forums.livecode.com/viewtopic.php?f=11&t=25307
Cheers.
http://forums.livecode.com/viewtopic.php?f=11&t=25307
Cheers.