Sunday, April 19, 2009

DOJO Tutorial

Dojo is a toolkit is an open source modular javaScript library. It used to ease the rapid development of Ajax based web application. First you have to download dojo.js from .
1. Create one dynamic web project in Eclipse IDE. (Say Project Name Dojo_Demo)
2. Put the downloaded dojo.js into WebContent folder of project. (Location C:\DOJO_workspace\Dojo_Demo\WebContent\demo.jsp, here C:\DOJO_workspace is project path).
3. Create one demo.jsp in same locatoin i.e. WebContent


<title>Binod Java Solution</title>
<script type="text/javascript">
function buttonCheck() { alert('YOU PRESSED OK BUTTON'); }
function init() {
var helloButton = dojo.widget.byId('button_first');
dojo.event.connect(helloButton, 'onClick')
dojo.addOnLoad(init); </script>
<body bgcolor="#FFFFCC">
<p align="center"><font size="6" color="#800000">Welcome to</font></p>
<button dojoType="Button" widgetId="button_first" onClick="buttonCheck();">OK BUTTON</button>

Add any web server (like Tomcat5.5) to your project then add Dojo_Demo project to server and start the server
Run http://localhost:8080/Dojo_Demo/demo.jsp
You will get dojo button, click and get your result. ........ :) So simple
Please give your comment, if you have any idea to enhance this tutorial ........ :)


  1. HI Binod. why don't you put the screenshots of this example for eclipse ide

  2. that's what dojo looks like? my buddy made it sound like coding in dojo would be about as hard as coding in straight binary... thanks for the quick tut


You can put your comments here (Either feedback or your Question related to blog)