Skip to main content

Posts

Showing posts with the label dojo vs jQuery

jQuery click vs on events

The . click () events are only attach to fully loaded elements and can't use for dynamic added elements and utilize more memory and create event handler for each child. The .click() requires to event handler for all element which are attached. It is produce the overhead at time for DOM manipulations. The   .on( )  events are used for both dynamic added elements and its consume less memory then .click() events. It allows creating the event handler which elements are added dynamically ways. The .on() will work for current and future elements and it a replacement of the bind(), live() and delegate() methods. The Example over click() vs. on() in details as given below, For .click() events :- The HTML code, < ul   id ="click">      < li > List items </ li > </ ul > The JavaScript code, $( '#click li' ).click( function  () {     $( this ).parent().append($( '<li>New List i...

What is $(document).ready() function? Why we use it?

The $(document). ready () function is  use to execute the code when the DOM is fully loaded.  We can say that $(document).ready() is an event which is fire when DOM is fully loaded or ready to use. Document Ready function:- We can call more than one document.ready() function in single page. The  document.ready()  function is called when  DOM  is not fully loaded that means rest of images, css or other 3rd party reference on page. It will not wait for the images, css or other 3rd party to get loaded. The ready and load events: 1.       $(document).on('ready', handler) 2.       $(document).on('load', handler) I Hope it is helpful to you! Thank you!

DOJO Toolkit hello world example

The Hello world example as below, < ! DOCTYPE html > < html > < head > < meta charset = "utf-8" > < title > dojo toolkit hello world example < /title > < script src = "//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js" data - dojo - config = "async: true" > < /script > < /head > < body > < h1 id = "selectorId" > Hello < /h1 > < script > require([ 'dojo/dom' , 'dojo/dom-construct' ], function (dom, dom_Construct) { var node = dom.byId( 'selectorId' ); dom_Construct.place( '<span> Anil Singh!</span>' , node); }); < /script > < /body > < /html > The output look like,

How to setup DOJO Application?

DOJO is a rapid development toolkit for web oriented software on desktop and mobile and internet applications without using the browser’s inbuilt graphics technology. There are basic tow ways for setup the initial configurations. 1.       AOL CDN or Google CDN (Content Delivery Network). 2.       Installing in your Server.

DOJO Components

The DOJO components look like, 1.       DOJO Grid 2.       DOJO Tree 3.       DOJO Filtering 4.       DOJO Button 5.       DOJO Calendar 6.       DOJO Combo-Box For more detail, https://dojotoolkit.org/documentation/tutorials/1.10/hello_dojo/

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); });...

JavaScript DOJO toolkit vs. jQuery

DOJO   is a rapid development toolkit for   web oriented software   on desktop and mobile and internet applications without using the browser’s inbuilt graphics technology created by Alex Russell , Dylan , David , and others in 2004. The jQuery is a JavaScript library created by John Resig in 2006. It is fast and light weight library. The DOJO provides us many more customizing options but it is a heavy and bulky toolkit but the JQuery is a fast and JQuery light library. The DOJO requires a higher bandwidth because it is heavy but not for JQuery . Right now, DOJO toolkit is not having well documented and tutorials. Due to this developers are facing so many difficulties to get in-depth for web development. The DOJO functionality looks like, //The DOJO Global Objects and functions looks like, dojo //The DOM Ready looks like, dojo .ready ( function () { }); //DOJO Id Selector looks like, dojo.byId( "selector-ids" ) //DOJO Class Select...

jQuery Interview Questions and Answers

What Is jQuery? jQuery is a fast and rich JavaScript library that work between the HTML and JavaScript and used to handle the various events, Ajax call and easy to communicate with APIs and it work with most of brewers. What is $(document).read () function? Why we use it? Difference between document.ready() and body onload in jquery What is jQuery.noConflict? Document ready vs. window load JQuery bind() vs. live() vs. delegate() vs. on() methods JQuery click vs. on events What is jQuery Selectors? The selectors are used to select the HTML elements from your HTML page. The selector can be css selector or custom selector. The selectors are start with $ and end with (). There are three types of selectors as given below. 1.       Selector can be used by tag name. i.e. $(div) 2.       Selector can be used by Ids. i.e. $("#ids") 3.       Selector can be used by css class. i.e. ...