Client-side development 1 - jQuery


Is jQuery a framework or a library

framework is something that usually forces a certain way of implementing a solution, whereas jQuery is just a tool to make implementing what you want to do easier. jQuery: The Write Less, Do More, JavaScript Library. For sure, it's a javascript library. ... And jQuery is just a single library 
Then jQuery is not a framework.

•Cross-browser compatible 
•Backward compatible

 The features provided by jQuery

•Reveal GUI elements
 •Change content (based on users’ actions) 
•Change CSS 
•Delta-Communication (Ajax)



jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is a JavaScript toolkit designed to simplify various tasks by writing less code. Here is the list of important core feature supported by jQuery 


The advantages and disadvantages of using jQuery in different project scales. 

The advantages of jQuery. The main advantage of jQuery is that it is much easier than its competitors. You can add plugins easily, translating this into a substantial saving of time and effort. ... Another advantage of jQuery over its competitors such as Flash and pure CSS is its excellent integration with AJAX


Advantages:
The main advantage of jQuery is that it is much easier than its competitors. You can add plugins easily, translating this into a substantial saving of time and effort. In fact, one of the main reasons why Resig and his team created jQuery was to buy time (in the web development world, time matters a lot).
The open source license of jQuery allows the library to always have constant and fast support, constantly publishing updates. The jQuery community is active and extremely hardworking.
Another advantage of jQuery over its competitors such as Flash and pure CSS is its excellent integration with AJAX
Disadvantages:

One of the main disadvantages of jQuery is a large number of published versions in a short time. It does not matter if you are running the latest version of jQuery, you will have to host the library yourself (and update it constantly), or download the library from Google (attractive, but can bring incompatibility problems with the code).
In addition to the problem of the versions, other disadvantages that we can mention:
  • jQuery is easy to install and learn, initially. But it’s not that easy if we compare it with CSS
  • If jQuery is improperly implemented as a Framework, the development environment can get out of control.
 How the jQuery handles the issues related to partial page loads to the browser

Through an extraordinary amount of hard work, jQuery effectively provides cross-browser compatibility for DOM traversal and manipulation, Event handling and delegation, XHR/Ajax logic, Element selection and document queries, Element attribute, and data management, as well as simple object management utilities. It does so without modifying the browser's native javascript implementation by providing a comprehensive abstraction layer.

 The selectors and their use in jQuery

jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria. Simply you can say, selectors are used to selecting one or more HTML elements using jQuery


jQuery selectors enable you to find DOM elements on the web page. ... XQuery includes various selector patterns e.g element name, #id, attributes, descendant elements, CSS class, input types, etc.
•jQuery can use CSS selectors
 •Additionally, provides advanced selectors to access elements faster and efficiently

Descendent selector

 The uses of CSS advanced selectors in jQuery and jQuery’s DOM  traversal API, indicating the pros and cons of them



•jQuery provides API to traverse through the DOM 
•These DOM navigating APIs are faster than advanced CSS like selectors

.Can navigate through the DOM, element by element
•Can use DOM element objects

 Importance of DOM objects and DOM processing in jQuery

Introduction. The Document Object Model (DOM) is a programming API for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. ... Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data


Benefits of using jQuery event handling over HTML event attributes, providing a list of events supported by jQuery


Event handlers can be set on elements, to be triggered by different events

How to declare jQuery event handlers outside the $(document).ready() function, indicating the need for that, and the related issues and solutions for them. 

Definition and Usage. The ready event occurs when the DOM (document object model) has been loaded. Because this event occurs after the document is ready, it is a good place to have all other jQuery events and functions. Like in the example above. The ready() method specifies what happens when a ready event occurs.


List of advanced features provided by jQuery and explain their use towards improving the user experience.
•(this) object refers to the current object within the scope 
•Inside event handlers, (this) refers to the element, the event has triggered on

Data attributes
Refactoring with DOM objects
Target on specific elements with generic names

Filters
CSS manipulation
Animation



Comments

Popular posts from this blog

THE CLIENT-SIDE DEVELOPMENT

RESTful Web services

RiWAs - Client-side development 2