|
JSXHelloWorld @Jun 7, 2007, 1:08:20 PM
About This TutorialThis "HelloWorld" tutorial has been divided into two sections;
Enabling JSX on HTML pageIn this section you will essentially test your JSX installation.
First create a 'index.html' page in your context root - the place where you've installed the JSX libraries.
To actually enable JSX Toolkit on your page, insert two
<html> <head> <script type="text/javascript">var jsxContext='.'; var jsxLogLevel='INFO';</script> <script type="text/javascript" src="./jsx/core.jsx"> </head> <body> TODO: insert some useful html code here. </body> </html> That's it! With above code in your page, you should be able to see a popup log window appear and log, that should be clear indication that JSX is enabled. First JSX packageEverything in your JSX enabled application should be done by packages. Some other frameworks create one monolithic .js file that holds everything, but this is not our way. The advantage of this approach is that you can load only those parts of JSX Toolkit (and your packages) that the page actually needs. This saves bandwidth, and of course, user frustration with slowly loading pages. If you want to write all your application code inside the head tags, be our guest. So, let's get started.
The jsxClass that was created is going to live inside the <html> <head> <script type="text/javascript">var jsxContext='.'; var jsxLogLevel='INFO';</script> <script type="text/javascript" src="./jsx/core.jsx"> </head> <body> <input type="button" id="ClickMe" name="ClickMe" value="ClickMe"> <script type="text/javascript">jsxBehavior("myapp.mypackage.MyClass", "ClickMe");</script> </body> </html> |
All contents copyright of the author. ©2007. JAMWiki Version 0.5.3 |