Page 1 of 1

LiveCode & JavaScript on the same page?

Posted: Sun Jun 09, 2013 7:06 pm
by steveharman
Hi,

I'm (fairly) sure I read somewhere that LiveCode & JavaScript can't be used on the same page?

If that's the case....why not?

I can understand something like PHP and LiveCode not co-existing on the same page, both being used as server-side scripting languages in this instance and needing their own pre-processing engine - but JavaScript is a client-side language (99.999% of the time) and processed by the browser / client device.

PHP & JavaScript can be used on the same page soooo....

I've probably missed something!

Thanks,

Steve

Re: LiveCode & JavaScript on the same page?

Posted: Sun Jun 09, 2013 7:13 pm
by FourthWorld
I mix the two all the time. Kinds hard to make modern web sites without JavaScript.

Re: LiveCode & JavaScript on the same page?

Posted: Sun Jun 09, 2013 7:33 pm
by steveharman
Thanks Richard, must have been my mis-reading of a slightly ambiguous statement elsewhere. I was starting to worry that JQuery was out of the question for LC pages.

Is there an elegant way to pass variables / data from LC to JS? Would it be a case of say including an LC variable between LC tags within JS to populate the value into JS?

You can tell I'm new to server-side LC!

Thanks again,

Steve

Re: LiveCode & JavaScript on the same page?

Posted: Sun Jun 09, 2013 9:56 pm
by FourthWorld
steveharman wrote:Is there an elegant way to pass variables / data from LC to JS? Would it be a case of say including an LC variable between LC tags within JS to populate the value into JS?

You can tell I'm new to server-side LC!
It's relatively new, so you're in good company since it wasn't that long ago that each of us was in the same place. :)

It's probably helpful to think of LC Server as occupying the same role as PHP in terms of its relationship to JS. So any of the examples for standard LAMP setups you find online for passing data from the web page to the server and back would likely apply with LC Server in more or less the same way, except that the server processing is done with the LC engine rather than the PHP engine.

Re: LiveCode & JavaScript on the same page?

Posted: Mon Jun 10, 2013 7:43 am
by bangkok
Ajax integration with LiveCode Server exemple :

http://samples.on-rev.com/ajax.irev