python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
DOJO toolkit ArcGIS API for JavaScript

How much DOJO do I need to know in order to use the ArcGIS API for JavaScript?

dojo.require: -

It is very similar to the <script> tag on an HTML page and like JavaScript, we imports resources into HTML page.

// AMD
require(["esri/map", ... ], function(Map, ... ){ ... });

// legacy
dojo.require("esri.map");

dojo.ready :-

It is very similar to <body onload="">. It is initializing to block after the page has finished loading.

// legacy
dojo.ready(init);

// AMD
require(["dojo/ready"], function(ready){
  ready(function(){     });
});


dojo.connect: -

It is very similar to JavaScript elements functions looks like,
1.      Element.addEventListener and
2.      Element.attachEvent.

It registers a listener event on an element on the page and returns results.
// legacy
dojo.connect(myMap, "onLoad", myLoadHandler);

// AMD
require(["esri/map", "dojo/on"], function(Map, on) {
  on(myMap, "load", callback);
});


dojo.byId: -

It is very similar to the JavaScript document.getElementById(id) function and this function returns the first HTML element with the argument ID.

// legacy
dojo.byId("myInputField").value = myMap.id;

ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions