Antun’s Blog

Notes on OpenLaszlo, LZX and Rich Internet Application Development

Antun’s Blog header image 4

Entries from June 2008

Testing Properties

June 24th, 2008 · No Comments

In LZX, it’s often sensible to test JavaScript properties before using them, to be sure that they are defined, e.g.
// Bad example
if (someObject.someValue) {
setAttribute(”x”, someObject.someValue);
} else {
var defaultValue = 123;
setAttribute(”x”, defaultValue);
}
In the above example, if someObject.someValue were undefined, then the conditional test would fail and the default value would be used. However there are a [...]

[Read more →]

Tags: LZX Tips · OpenLaszlo