Open In App

Difference between jQuery and Dojo

Last Updated : 11 Mar, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

jQuery is a Javascript library. jQuery is also known as the “write less, do more” library, because of writing fewer lines of code. It consists of multiple events such as jQuery click(), jQuery dbclick(), jQuery mouseenter(), etc. It makes things like HTML document traversal and manipulation, etc.

DOJO is a javascript toolkit. It includes 4 components used in it, they are as follows:

  • Core — This component contains the central and non-visual modules.
  • Dojox — This component consists of experimental modules that are not yet stable enough to be included in Dojo and Dijit.
  • Util — This component contains build tools for style checking, automation, optimization, and documentation.
  • Dijit — This is a widget and layout library for the user interface.

DOJO is used on high-profile, high-traffic sites. Its package system makes it easy to manage large-scale UI development projects. Dojo abstracts the differences among diverse browsers to provide APIs that will work on all of them.

jQuery-vs-DOJO

Following is a table of Differences between jQuery and DOJO:

 

JQuery

DOJO

1. It is a Javascript library that simplifies Javascript Programming. Dojo is an Open-source Javascript library. Javascript Programming.
2. Jquery is useful when we need to use Javascript on our website. It is useful to develop Javascript-based applications and websites.
3. It is useful to handle HTML DOM tree traversal and CSS. It offers widgets, utilities, and higher IO abstraction.
4. It helps the users to write UI-related function code in minimum possible lines. It supports Loosely typed variables, Objects, classes, Associative arrays, etc.
5. Many Tech Companies use jQuery on their website. It can be used in JavaScript-based Adobe AIR applications.
6. It improves the performance of an application and develops Browser Compatibility on web applications.  DOJO DOM can be used to insert, create, delete, read and upgrade the elements on a webpage.
7. It is grouped under Javascript UI libraries. It is a Progressive TypeScript Framework for Modern Web Apps.
8.

Example of jQuery -:

jQuery uses CSS-style selectors to select parts, or elements, of an HTML page.

Examples of Dojo are -:

World clock, static blog, etc.

Example of jQuery: 

HTML




<!DOCTYPE html>
<html>
<head>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
</script>
</head>
<body>
  
  
<p>If you click on me, I will disappear.</p>
  
  
<p>Click me away!</p>
  
  
<p>Click me too!</p>
  
  
</body>
</html>


 Explanation: In the above code we have used the following selectors of jQuery

1. click(function) 

2. $(this).hide() -: It hides the current HTML element ( In above code the current HTML element is <p>). 

Example of DOJO:

HTML




<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Hello GFG!</title>
</head>
<body>
    <h1 id="greeting">Hello</h1>
    <!-- load Dojo -->
    <script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"
            data-dojo-config="async: true"></script>
</body>
</html>




Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads