LiveCode & JavaScript on the same page?

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
steveharman
Posts: 26
Joined: Fri Apr 12, 2013 11:03 am

LiveCode & JavaScript on the same page?

Post by steveharman » Sun Jun 09, 2013 7:06 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8557
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LiveCode & JavaScript on the same page?

Post by FourthWorld » Sun Jun 09, 2013 7:13 pm

I mix the two all the time. Kinds hard to make modern web sites without JavaScript.
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

steveharman
Posts: 26
Joined: Fri Apr 12, 2013 11:03 am

Re: LiveCode & JavaScript on the same page?

Post by steveharman » Sun Jun 09, 2013 7:33 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8557
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LiveCode & JavaScript on the same page?

Post by FourthWorld » Sun Jun 09, 2013 9:56 pm

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.
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 932
Joined: Fri Aug 15, 2008 7:15 am

Re: LiveCode & JavaScript on the same page?

Post by bangkok » Mon Jun 10, 2013 7:43 am

Ajax integration with LiveCode Server exemple :

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

Post Reply

Return to “CGIs and the Server”