JavaScript-Livecode integration question

Heriberto Torrado htorrado at networkdreams.net
Thu Jun 18 16:12:51 EDT 2020


Hi Ralph,

Thanks you very much for your quick response!

I found some information about the command 
"revBrowserAddJavaScriptHandler", but you say I can use the command 
"javascriptHandlers".
it's that new? I cannot find information about it on the Livecode 
dictionary.

Anyway, I'm going to try it and I'll tell you if it works.

I think a lot of  people will ask me why I want to do that, and why I 
just don't use Electron.. :-)
I don't want to create a flame, so this these are my reasons.

1) I have an strong background with HTML, CSS and Javascript, but I love 
Livecode scripting (especially its strong text manipulation options.).
2) If you use the Indy edition, it's easy to hide the code (passwords, 
command calls, etc). It's not possible to do it with Electron or NW.js 
(NW.js has more options to do that, but they are far to be ideal).
3) I don't like nodejs: promises, asynchronous technology, difficult 
tracing errors, etc.

Best,
Hery


On 6/18/20 3:21 PM, Ralph DiMola via use-livecode wrote:
> Heriberto,
>
> LC makes it easy... Works for me on Mobile also.
>
> In LC do this once.
> set the javascriptHandlers of widget "MyBrowerWidget" to "LCHandlerName"
>
> Create this handler:
>
> command LCHandlerName pNum
> answer pNum
> end LCHandlerName
>
> Javascript:
> liveCode.LCHandlerName('315');
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdimola at evergreeninfo.net
>
> -----Original Message-----
> From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Heriberto Torrado via use-livecode
> Sent: Thursday, June 18, 2020 2:27 PM
> To: use-livecode at lists.runrev.com
> Cc: Heriberto Torrado
> Subject: JavaScript-Livecode integration question
>
> Dear LiveCode programmers.
>
> I have a question about the Livecode-Javascript integration.
>
> I love LiveCode, but IMO I think CSS+HTML+JS are better technologies for styling applications (it is just a personal opinion).
>
> So, I'm trying  to create Deskops apps using JS+HTML+CSS for the "front"
> and LiveCode for  the "back-end".
> I'm using the CEF embedded browser.
>
> My idea is to create something like Electron or NW.js but using Livecode.
>
> Note that I'm talking about Desktop apps, not Web apps.
>
> I have managed to send data from Livecode to JavaScript using the instruction  "do "document.getElementById -xxxxxx" in widget "Browser", but I'm stuck doing the opposite.
> My idea is to send an event or data from the CEF to Livecode when someone press a button on the CEF embedded browser.
>
> I found the documentation confused and I'd like to have, if it is possible, a real example about how to do that.
>
> Another question: Does it works on Android/Apple? I'm afraid it won't work
>
>
> Thanks a lot.
>
> PS: I'm going to try to answer you guys as soon as possible, but sometimes I have to read your responses on the use-livecode mail list archives , because our mail server has the ugly habit of blocking some emails that come from the list.
>

-- 

Best regards/ Saludos cordiales/ Cordialement

Heriberto Torrado
​Chief Technology Officer (CTO)
​Director de informática
Directeur informatique

*NetDreams S.C.*
http://www.networkdreams.net

  Address / Dirección / Adresse:​

*USA: *538 East 85th Street, #1C Manhattan NY, NY 10028 USA
*Europe / Europa: *Paseo de la Castellana 135 10ª Planta Madrid 28024 
Spain / España

*Tel - Phone - Fax:*

Phone / Tel USA : +1 917 287 5644 / +1 646 596 8787
Phone / Tel Spain :+34 627 556 500 / + 34 91 063 74 48

    Please consider the environment before printing this email / Por 
favor considera tu responsabilidad medioambiental antes de imprimir esta 
página.

Confidentiality: The information contained in this message as well as 
the attached file(s) is confidential/privileged and is only intended for 
the person(s) to whom it is addressed. If the reader of this message is 
not the intended recipient or the employee or agent responsible for 
delivering the message to the intended recipient, or you have received 
this comunication in error, please be aware that any dissemination, 
distribution or duplication is strictly prohibited, and can be illegal, 
and please notify us immediately and return the original message to us 
at the address above. Thank you.

Confidencialidad: La información contenida en este mensaje y/o 
archivo(s) adjunto(s) es confidencial/privilegiada y está destinada a 
ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Si usted 
lee este mensaje y no es el destinatario señalado, el empleado o el 
agente responsable de entregar el mensaje al destinatario, o ha recibido 
esta comunicación por error, le informamos que está totalmente 
prohibida, y puede ser ilegal, cualquier divulgación, distribución o 
reproducción de esta comunicación, y le rogamos que nos lo notifique 
inmediatamente y nos devuelva el mensaje original a la dirección arriba 
mencionada. Gracias.

Viruses: Although we have taken steps to insure that this e-mail and 
attachments are free from any virus, we advise that in keeping with good 
computing practice, the recipient should ensure they are actually virus 
free.

Virus: Aunque hemos tomado las medidas para asegurarnos que este correo 
electrónico y sus ficheros adjuntos están libres de virus, le 
recomendamos que a efectos de mantener buenas prácticas de seguridad, el 
receptor debe asegurarse que este correo y sus ficheros adjuntos están 
libres de virus.




More information about the use-livecode mailing list