LC Server Call Javascript Function?

Peter TB Brett peter.brett at livecode.com
Fri Jan 29 06:08:28 EST 2016


On 2016-01-29 11:30, Scott Rossi wrote:
> Can a LiveCode server script call a Javascript function?
> 
> I want to write some text into a div in an LC server web page without
> refreshing the entire page.  AFAICT, generating any text from a 
> LiveCode
> server script will replace the contents of page, but cannot target a a
> specific DOM element on the page.  Since Javascript can do this, is 
> there
> any way to trigger a Javascript function from an LC server script?

The normal way to do this would be to write some JavaScript that 
performs an XMLHttpRequest to the LiveCode server script, and then sets 
the innerHTML of the <div> element.

Don't forget that JavaScript runs on the client, and LiveCode runs on 
the server.  There are things you can do in a LiveCode server script 
that you can't in JavaScript, and vice versa.

                                           Peter

-- 
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Open Source Team

LiveCode on reddit! <https://reddit.com/r/livecode>




More information about the use-livecode mailing list