javascript talk to livecode through browser

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
rblackmore245
Posts: 67
Joined: Fri Jun 12, 2015 9:42 am

javascript talk to livecode through browser

Post by rblackmore245 » Thu May 05, 2016 4:49 pm

Is is possible to pass data from JavaScript to livecode from webpage running in the browser within livecode ?

rblackmore245
Posts: 67
Joined: Fri Jun 12, 2015 9:42 am

Re: javascript talk to livecode through browser

Post by rblackmore245 » Mon May 09, 2016 10:44 am

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!");
}

lilRalph
Posts: 23
Joined: Wed Aug 26, 2015 9:43 am

Re: javascript talk to livecode through browser

Post by lilRalph » Mon Jun 06, 2016 10:33 am

Or you could have a look at the code samples and stacks here

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

Cheers.

Post Reply

Return to “Internet”