If you are a web developer obviously you must have heard about java-script.Yes, java-script is a powerful client-side scripting language. Like any other languages we have lot of libraries available based on the java-script to enhance the power and flexibility of developing client-side scripts. The very common one is jquery. There are also libraries like Prototype, MooTools etc. But, today I want to introduce you a more powerful java-script (widget) library, the Dojo.
Before discussing about Dojo, let try out a simple 'Hello World !!!' program using dojo. You can include the dojo library into your web page either by
- Downloading Dojo Toolkit which is available at http://dojotoolkit.org/download/. or
- By using dojo library provide over any content delivery networks (CDN).(such as google)
Take you favorite editor and copy and paste the code shown below.
<!DOCTYPE html>
<html>
<head>
<title> Tutorial 01 : Hello World !!! </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h1 id="headingId"> Initial value </h1>
<!-- Load Dojo -->
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"
data-dojo-config="async: true" ></script>
<script>
require(["dojo/dom", "dojo/domReady!"], function(dom){
var heading = dom.byId("headingId");
heading.innerHTML = " Hello World !!! ";
console.log(" Hello World !!! ");
});
</script>
</body>
</html>
