Hi all,
Any one know how can call LiveCode command from browser with javascript handler ?
I used LiveCode 8.0.0 stable version and browser widget, to do that we defined a handler to respond to javascript calls. Then we set javascript handler of the browser widget to our handler. And created a separate web page where the browser calls a LiveCode function.
It works good on Windows and Mac. As for IOS, handler works but the result pops-up with different frequency.
And the handler didn't work on Android.
Any help will be appreciated.
Thanks.
Javascript handler issue on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Javascript handler issue on Android
Hello Armenhui -
Are you using the CEF browser specifically? If so, please post the example code that works for other platforms and we'll see what we can do.
BTW: installed Playland Armenia yesterday - good fun, your team did a great job.
Are you using the CEF browser specifically? If so, please post the example code that works for other platforms and we'll see what we can do.
BTW: installed Playland Armenia yesterday - good fun, your team did a great job.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Javascript handler issue on Android
Thank you for good words.
No We do not use CEF browser, We use LiveCode 8.0.0 Browse Widget.
This is card script code
This is html code where we call LiveCode myJSHandler handler
No We do not use CEF browser, We use LiveCode 8.0.0 Browse Widget.
This is card script code
Code: Select all
on opencard
-- Set URL for Mybrowser widget
set the URL of widget "MyBrowser" to "http://lc13754376.on-rev.com/testBrowser"
-- Set up the browser javascript handler list
-- This code goes in a suitable setup handler
set the javascriptHandlers of widget "MyBrowser" to "myJSHandler"
end opencard
-- Define a handler to respond to javascript calls.
on myJSHandler pMessage, pValue
-- Do appropriate actions here.
answer"hello world"
end myJSHandler
This is html code where we call LiveCode myJSHandler handler
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<input type="button" value="click" onclick="liveCode.myJSHandler('myMessage',12345)" style="width:300px;height:70px;">
</body>
</html>
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Javascript handler issue on Android
Thanks, Armenhui. I discussed this with one of the lead engineers this morning, and he pointed me to a bug report which turns out to be yours:
http://quality.livecode.com/show_bug.cgi?id=17620
Hopefully the workaround Panos noted there will work out well for what you need. If not let us know and we'll see if we can come up with a solution for you.
http://quality.livecode.com/show_bug.cgi?id=17620
Hopefully the workaround Panos noted there will work out well for what you need. If not let us know and we'll see if we can come up with a solution for you.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn