DOJO
Dojo is a lightweight javascript library which have the following features:
- Lightweight
- Provide object oriented features
- Help to build AJAX rich application
- Large scale web application can be built
- Provide widget library
- Saves development time
- Prevent cross browser inconsistency
- And many more
Follow the instruction to get started with dojo :
- Download stable version of dojo from dojotoolkit.org
- In your www directory of wamp server make a folder named learndojo, in the folder learndojo make another directory dojoroot.
- Unzip the downloaded dojo library in this dojoroot directory, directory structure should be like www/learndojo/dojoroot/dojo/dojo.js . The file dojo.js is present in the dojo folder of your unzipped directories.
- In the learndojo directory make a file and named it index.html which have the following code.
<html> <head> <title>Learning Dojo</title> <!--Below line includes the dojo.js files from the directory dojoroot/dojo/ --> <script src="dojoroot/dojo/dojo.js"> </script> </head> <body> <h1>Learning Dojo</h1> <div id="message">Following are some features of dojo</div> <ul id="list"> <li>Rich Internet application, saving development time</li> <li class="highlight">Dojo have widget library and object oriented features which helps to build a AJAX powered web application</li> <li>Extremely light-weight</li> </ul> </script> <script> /*Here dojo.onLoad is a function which will create a div on this page gets loaded and will add the text Hello learner.... to the body of this page. */ dojo.addOnLoad(function() { dojo.create( "div", { "innerHTML": "Hello, Learner. I hope you are enjoying dojo!" }, dojo.body() ); }); </script> </body> </html>
In the above code, the we have included dojo.js in the <head> section and we are using dojo to create a div dynamically when the web page gets loaded.
The dojo.onLoad function creates a div and add the text to the body "Hello learner, I hope you are enjoying dojo".
The same working code you can fork from git also.
No comments:
Post a Comment