View Full Version : Communication between Laszlo-generated interface and the outside world
i was wondering how to 'communicate with the outside world' from a laszlo-generated interface?...
for example can i put some javascript or whatever in an html page with a laszlo-swf to define global variables and then use them inside the laszlo interface?
i think swf files deal more with actionscript than with javascript but i don't mind: i just wanna know how to interact with the localhost from a laszlo interface, whatever it takes...
thx
antun
05-17-2004, 09:02 AM
You can pass paramaters to the Laszlo app by adding query paramaters to the source of your own HTML wrapper page in the <object/embed> tags. You could do this in one of three ways:
1) Hard code the values in the HTML page.
2) Generate the HTML page on the server and add the values there.
3) Use browser javascript to write the <object/embed> tags in the HTML page.
You can also call some browser javascript from the Laszlo app by using LzBrowser.loadURL( 'javascript:...' ).
2-way browser JavaScript integration is coming in a future release of the LPS.
Another way of passing information to the Laszlo app is via cookies. You can set a cookie however you like, and then read it from a data request.
-Antun
You can also call some browser javascript from the Laszlo app by using LzBrowser.loadURL( 'javascript:...' ).
so this is a way to transfer some information from the laszlo interface to the rest of the world; what about the other direction ? (how can a javascript 'drive' a laszlo interface?)
EDIT : ok, i had skipped the sentence about 2-way javascript...
whisperstorm
05-21-2004, 05:06 PM
One kludgey way might be to use the cookie as a mediator. js writes to the cookie - the lzx code looks for changes in the cookie every few seconds and picks up new information. However this is extremely kludgy...
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.