Friday 8 April 2016

Understand Core Differences between JavaScript and jQuery

JavaScript is a computer language mainly used for making interactive websites under front end web development. It provides a rich user experience for the websites. It is used along with HTML and CSS. HTML defines the content and CSS is used to give appearance like background color, fonts etc to a web page. The main purpose of JavaScript is to add behavior to the page without loading a new page. We only make a static website by using HTML and CSS, JavaScript add interaction in it for the visitor and improves visitor experience. JavaScript is also used not only over the web but also in PDF documents, desktop widgets etc.

jQuery is a JavaScript library having pre-written JavaScript codes by John Resig. jQuery makes the coding easy for JavaScript web developers. It is the set of codes written in JavaScript. Every thing in jQuery is derived from JavaScript.

The core difference between them is that, JavaScript is a programming language and jQuery is library of it. jQuery is nothing without JavaScript as it is developed in JavaScript itself. If we write code in JavaScript only then it takes time and almost impossible to write a perfect code but in jQuery, there is no necessities to write much scripting. Write less and do more is the theme of jQuery.

JavaScript is based on Object Oriented Programming while jQuery is cross platform library to make client side scripting easy. jQuery allows to focus on the problem and no need to take care about the JavaScript code. We can do complex things by writing a single statement in the editor in jQuery that if we do same in JavaScript needs lots of coding and debugging.

Following are the main difference between jQuery and JavaScript

  • Java-script works with ECMA and DOM while jQuery has only DOM
  • Animation are straight away possible with jQuery
  • jQuery provides a better compatibility while JavaScript has some issues with various browsers and their versions.
  • jQuery written in JavaScript

Performance

Both jQuery and JavaScript have almost equal performance speed. jQuery has been tried in the course of recent years and it turned out to be quick and predictable.

Advantage to Adding jQuery:

  • Wide range of plug-ins available so you don't need to write code every time
  • It is light weight compared to other frameworks of JavaScript
  • Easy to extend an active community
  • Uses simple and powerful syntax

JavaScript advantages and disadvantages:

Advantages

  • Executed on the client side
  • Relatively fast to the end user
  • Uses extended functionality

Disadvantages

  • Fights with security
  • Irregularity as far as usefulness and interface

jQuery is a good library of JavaScript, which easily works with various browsers. But for getting good command over jQuery one should have proper understanding of JavaScript. It is simple and have many pre made plug-ins and widgets. On the other hand JavaScript is good for object oriented based application.


No comments:

Post a Comment