10 good reasons for using jquery as your javascript framework

December 20, 2010

I’m a jquery lover - I admit. ever since I started using this excellent framework - I got hooked.

Since I’m consider myself a core javascript developer, I tend to test and research before I choose to use others work. Well - Jquery has passed the test!

Nowadays, when developing in javascript, a developer has to be able to code for all browsers at least (in my opinion and as a proof of concept from our reality). It’s one of the most common requirements a javascript project must take into an account when developing any project. The browsers market is changing and people are getting to know few browsers and tend to prefer one over the other.

There are many good reasons for why using jquery as your javascript framework. After working for quite some time with jquery in big and small projects, these are my top reasons:

10 Good Reasons for using Jquery as your Javascript framework

  1. Easy to use
if you have a hidden element (of any kind - li, div, td, etc) - in order to show it, it's "display" property has to set the its proper "block" state. Each element has its own native "block" state. Jquery does that simply with the show() method:


So - if it's a "td" element, in modern browsers (such as firefox, chrome, webkit etc..) this method will set its display property to "table-cell".
  1. Performance
Jquery uses a <a title="javascript document fragment" href="http://ejohn.org/blog/dom-documentfragments/" target="_blank">document fragment</a> for some inner dom processing - which results in faster dom manipulations such as: appending html content, removing elements etc.
  1. CSS (xpath) selector syntax to retrieve elements
one of the most common actions in jquery is to get a set of elements (or one element) and perform one or more actions on it. Jquery uses the sizzle engine to retrieve dom elements. Sizzle uses the convenient simple css syntax to describe the elements it will try to retrieve.

i.e., if i want to retrieve all elements with class "my-class", which has a div ancestor: **$(&#8216;div .my-class')**.
  1. Easy Ajax
Jquery has implemented a very convenient and easy cross-browser ajax. Handling callbacks, passing values as json or other data format is straight forward. Moreover, there are simplified versions of the **$.****ajax()** method for just **$.****get()** for loading a url, **$.****getJSON()** for loading json data and **$.****post()** method for posting data to the  server (using POST method).
  1. Plugin System
One is able to extend jquery by plugins. Jquery plugins are usually additional javascript code which is overloaded to the Jquery object, allowing to achieve components, effects and easy tasks like **$(element).grid()**, **$(element).treeview()**, **$(element).editable()** etc. the Jquery website hosts thousands of useful plugins for free use, all categorized by its relevance - you don't need to reinvent the wheel - some of it is already there (if not all) and you can use it, extend it and learn from it.
  1. Worldwide community support
Jquery is being used by many (millions&#8230;). Microsoft officially <a title="Microsoft support jquery library" href="http://www.microsoft.com/web/library/details.aspx?id=microsoft-adopts-open-source-jQuery-JavaScript-library" target="_blank">supports</a> this library integrating tools in its developer web tools, the web is full with tutorials, mentors and help using jquery for any project or use.
  1. Excellent Event Management System

  2. jquery has a very convenient event management. you can bind events easily and you get an event object (again, cross-browser) with useful properties. One addition that I like is the ability to have a namespace for any event, i.e.:


Now, when myId is clicked, it will trigger a click with the additional property of "anyObject" as a namespace. In fact, you can use this namspace again for more objects.
  1. Getting form element values
Again. the elegant way of getting values from any form element is simply as: **$(&#8216;#someFormElement').val()**.

However, you can also use the form function $(&#8216;myForm').serialize() to retrieve a query string which includes the form elements with their values ready to be sent with an ajax call.
  1. Get the source dom element
Sometimes, you'll want to use the source dom element resulted in your jquery object,so you can finally revert back and get the reference source dom object easily with: **$(&#8216;.myClass').get(5);** (where you can use any index to get any object in the jquery result set).

These are some of my 10 good reasons for using jquery. I’m sure there are a lot of other good reasons for using jquery in your projects. It’s fast, it’s dynamic, it’s open source, it’s cross-browser and it’s beautiful and elegant. I’m sure once you start developing with it, you’ll feel very comfortable and you’ll get the feeling of where it can assist you and save time while writing elegant code.

My Consulting Packages

My consulting offerings include: Front End Development, Code reviews (React, Redux, Typescript, Javascript, Angular, NgRx), workshops, Consulting and Development. Feel free to reach out thru the below forms or through thecontact page.

© 2022, Built with Gatsby, follow me at: