jQuery
- hassamadhi9594
- May 15, 2019
- 4 min read

jQuery is a framework/library, which can hide the complexity of the pure JS.
jQuery is a write less and do more javascript library.
It helps us to make the use of javascript much easier.
It simplifies the complicated things from javascript like the AJAX calls and the DOM manipulation.
jQuery can be library as it's mostly assist your coding without affecting. Or it can be framework as it allows you to write small set of codes to achieve likes of animations, UI toggles, etc.
Features of jQuery are :
1. Effects and animations. 2. Ajax. 3. Extensibility. 4. DOM element selections functions. 5. Events. 6. CSS manipulation. 7. Utilities - such as browser version and the each function. 8. JavaScript Plugins. 9. DOM traversal and modification.

Advantages and Disadvantages of using jQuery in different project scales :
The biggest advantage to jQuery is ubiquity. It had a profound effect on JavaScript development and echoes of its use can be found all over the internet. Many people continue to learn it (and rightfully so) before they advance to frameworks and many other tools implement some features from it.
It's biggest disadvantage would be sheer size. jQuery was made to make a lot of the things we do with JavaScript easier. The problem is we wanted it to do more. While it's still an excellent tool, it's now much larger than it needs to be for most uses because it still needs to cater to edge cases.
The PartialView Method
In ASP.NET MVC, a partial view is analogous to user controls in ASP.NET Web Forms. A partial view is a chunk of HTML that can be safely inserted into an existing DOM. Most commonly, partial views are used to componentize Razor views and make them easier to build and update. Partial views can also be returned directly from controller methods. In this case, the browser still receives text/html content but not necessarily HTML content that makes up an entire page. As a result, if a URL that returns a partial view is directly invoked from the address bar of a browser, an incomplete page may be displayed. This may be something like a page that misses title, script and style sheets. However, when the same URL is invoked via script, and the response is used to insert HTML within the existing DOM, then the net effect for the end user may be much better and nicer.
jQuery - Selectors

jQuery can use CSS selectors. Additionally, provides advanced selectors to access elements faster and efficiently
The jQuery library harnesses the power of Cascading Style Sheets (CSS) selectors to let us quickly and easily access elements or groups of elements in the Document Object Model (DOM).
A 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 select one or more HTML elements using jQuery. Once an element is selected then we can perform various operations on that selected element.
DOM, DOM NAVIGATION, AND DOM OBJECTS
Query provides API to traverse through the DOM. These DOM navigating APIs are faster than advanced CSS like selectors.

The Document Object Model (DOM) is used to store the tree of XUL nodes. When an XUL file is loaded, the tags are parsed and converted into a hierarchical document structure of nodes, one for each tag and block of text. The DOM structure may be examined and modified using various methods provided for this purpose. Specific XUL elements also provide additional functions which may be used.
Each XUL file that is loaded will have its own document displayed in a window or frame. Although there is only ever one document associated with a window at a time, you may load additional documents using various methods.
In Mozilla, the DOM may be accessed and manipulated using JavaScript. The various DOM objects have functions which may be accessed in script, however, it is important to note that the DOM is an API that is accessible by JavaScript. JavaScript itself is just a scripting language that can access these objects because Mozilla provides these objects for use.
In JavaScript, there is always a single global object that is always available. You can refer to the properties and methods of the global object without having to qualify them with an object. For example, if the global object has a 'name' property, you can change the name with the code 'name = 7', without having to specify any object to use. In a browser context, the window is the global object, and the same is also true for XUL. Naturally, this global object will be different for each window. Each frame will also have a separate window object.

jQuery Event Methods

jQuery is tailor-made to respond to events in an HTML page.

What are Events?
All the different visitors' actions that a web page can respond to are called events.
An event represents the precise moment when something happens.
Examples:
moving a mouse over an elementselecting a radio buttonclicking on an element
The term "fires/fired" is often used with events. Example: "The keypress event is fired, the moment you press a key".
Query is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

ADVANCED FEATURES
(this) object refers to the current object within the scope. Inside event handlers, (this) refers to the element, the event has triggered on


How to insert the <p> at the
end of the <li>, referring to
the button?

•Data attributes

•Refactoring with DOM objects

•Target on specific elements with generic names

• Filters

•CSS manipulation

•Animation

תגובות