The debug attribute of the canvas is magic. It enables debugging in
the same way that ?debug=true does on the request url. If you want
to know if debugging is on, the compiler defines the constant `
$debug` as true when debugging is on. You can conditionalize your
code also:
if ($debug) {
<code that will happen only if debugging is on>
}
The compiler will optimize away the `if` and either insert the code
or not, depending on the state of debugging.
I guess you could call this a bug. There is not a real good reason
for the debug attribute to be so magical. It just evolved that way.
See also: http://weblog.openlaszlo.org/archives/2005/11/conditional-
compilation/
There is a bug open on this, http://jira.openlaszlo.org/jira/browse/
LPP-987, currently unassigned.
On 2007-05-08, at 11:58 EDT, Jean-Baptiste BRIAUD wrote:
Hi the list,
I try to get the value of canvas.debug either by getAttribute or
direct access it does not work.
It is always undefined wherever I try that in handler for oninit,
onconstruct (never called) or in the <script> tag.
Debug.write("canvas.debug = " + canvas.getAttribute("debug"));
or
Debug.write("canvas.debug = " + canvas.debug);
Did I forgot something ?
Thanks,
JBB.