PDA

View Full Version : on-line javascript reference


johnagrandy
09-11-2003, 03:34 PM
what are people using for an on-line javascript reference?

specifically i had a question about exactly which characters the Escape() function replaces ... and i left my javascript books at home ...

which leads me to my question ....

antun
09-11-2003, 03:48 PM
I'm not sure about an online reference, but escape() escapes all non-digit or a basic unaccented Latin character.

You'd use it for the part of a string you want to pass as the value of a CGI variable.

-Antun

whisperstorm
09-23-2003, 10:23 AM
I too would like a specific guide to using javascript in laszlo. It took me forever to figure out how to just pop open a window and that was just from looking at other's code. What is the Laszlo "DOM"?

antun
09-23-2003, 10:39 AM
In general you can always new a class:

var a = new window()

There's a bit more on that here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=102

As for the Laszlo DOM, effectively it is the XML structure of your app. Laszlo's not like HTML where there is a "different" DOM from the HTML you write.


<canvas>
<view name="foo">
<view name="bar" id="ta" />
</view>

<view name="myView">
<method name="myMethod">
// See below
</method>
<view>
</canvas>


bar can be accessed absolutely from myView as follows:


// Relative
parent.foo.bar;

// Absolute
canvas.foo.bar;
foo.bar; // Canvas is assumed

// Global
ta;


Does that answer your question? If you run into any difficulties, do post them on the forums - it can help us write the docs to clarify this.

-Antun

whisperstorm
09-23-2003, 11:47 AM
That's part of it, but just like pages have document. stuff or Math or Date, there are things like

http://www.laszlosystems.com/developers/learn/documentation/lzxref/lzbrowser.php

lzbrowser, lzcursor, etc. That are special objects in lazslo world...

I see in the reference many of these are listed under "service" --- that's not too helpful or discoverable :)

antun
09-25-2003, 01:31 PM
With regards to Math and Date, they're both native JavaScript classes, and (as you noted) unfortunately they're not covered by the LZX Reference right now. We've known about this for some time now.

You can always download the ECMA-262 JavaScript standard from the ECMA websited:

http://www.ecma-international.org/

... however I notice that the site appears to be down at the moment.

The Laszlo User Group has some pages on the divergance of LZX from the ECMA-262 standard:

http://www.laszlouser.org/page.cfm?doc=JavascriptCode&wikiid=1944&wpid=0

As for services, I've filed a feature request to get some better content on this page:

http://www.laszlosystems.com/developers/learn/documentation/lzxref/info-tiers.php#Services

For your benefit, a service is an instance of a class that is always available to you in script. You don't need to new it, and you can reference it from anywhere. Things like managers (modality managers, keyboard event handlers etc.) are usually bundled there. I belive that other programming languages do use this concept.

Thanks for pointing these out! Feedback is always appreciated.

-Antun