你可以在java.net中查阅"Laszlo: An Open Source Framework for Rich Internet applications"(作者:Bill Grosso )来获取关于这种平台的基本原理.本文中,我将会谈论语言的一些基本原则,这些原则在你使用LZX编写程序时将会派上用场.至于更深一步的学习,可以求助于Laszlo站点的文档.
<canvas width="800" debug="true"><debug x="450" y="0" height="300"/><class name="test"> <attribute name="a1" type="string"/> <attribute name="b1"/></class><!--Instantiating a class--><test name="testInstance"> <!--Demonstrating an onchange for attribute event--> <method event="ona1" name="ona1Method"> Debug.write("hey this works"); </method></test><!-- Simulating an alert --><!-- Instantiate a modal alert dialog --><alert name="myalert" width="100" y="100"> hi - initial text</alert><!-- A method to work the modal dialog --><method name="showAlert" args="displayText"> canvas.myalert.setAttribute("text",displayText); canvas.myalert.open();</method><!-- Testing the alert function --><button onclick="canvas.showAlert('Alert Button Pressed')"> Show Alert</button></canvas>
<canvas width="800" debug="true"><debug x="450" y="0" height="300"/><class name="test"> <attribute name="a1" type="string"/> <attribute name="b1"/></class><!--Instantiating a class--><test name="testInstance"> <!--Demonstrating an onchange for attribute event--> <method event="ona1" name="ona1Method"> Debug.write("hey this works"); </method> </test><!-- Simulating an alert --><!-- A modal alert dialog --><alert name="myalert" width="100" y="100"> hi - initial text</alert><!-- A method to work the modal dialog --><method name="showAlert" args="displayText"> canvas.myalert.setAttribute("text",displayText); canvas.myalert.open();</method><!-- Testing the alert function --><button onclick="canvas.respondToButton()">Show Alert</button><method name="respondToButton" > //PRepare a string var somestring = "Hey, I am setting the a1 attributes value"; //Write a debug to see it Debug.write(somestring); //Call the alert to see it showAlert(somestring); //Go ahead and set the attribute canvas.testInstance.setAttribute("a1",'satya'); //The above will fire an event causing //"ona1Method" to execute. //You will see this in the debugger</method><