Tute 10
1.Is jQuery a framework or a library? Discuss.
2. Explain the features provided by jQuery?
3. Discuss the advantages and disadvantages of using jQuery in different project scales.
4. Explain 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.
5. Discuss the selectors and their use in jQuery.
8. Discuss the benefits of using jQuery event handling over HTML event attributes, providing a list of events supported by jQuery.
9. Explain how to declare jQuery event handlers outside the $(document).ready() function, indicating the need for that, and the related issues and solutions for them.
- jQuery 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.
- With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
- It is a collection of software libraries providing a defined application programming interface.
- Frameworks contain key distinguishing features that separate them from normal libraries:
- Therefore jquery is a library not a framework.
2. Explain the features provided by jQuery?
- Simple and easy
- Lightweight
- CSS manipulation
- Html manipulation
- Cross browser support
- Event handling
- JavaScript Library
- Ajax Support
- Built-in Animation
JQuery Feature and Explanation.
- Simple and easy: It have predefined method using you can perform any task easily compare to JavaScript. And it is easy to learn.
- Lightweight: It is very lightweight library - about 19KB in size ( Minified and gzipped ).
- CSS manipulation: It have predefined css() method for manipulate style for any Html elements.
- Html manipulation: The jQuery made it easy to select DOM elements, traverse them and modifying their content.
- Cross browser support: It support all modern web-browser including IE-6.
- Event handling: It support event handling like click mouse button.
- JavaScript Library: It is JavaScript library.
- Ajax Support: It support ajax, you can develop a responsive and feature-rich site using AJAX technology.
- Built-in Animation: It have predefined method "animate()" for create custom animation on web-page.
3. Discuss the advantages and disadvantages of using jQuery in different project scales.
Advantages of JQuery
- jQuery is flexible and fast for web development
- It comes with an MIT license and is Open Source
- It has an excellent support community
- It has Plugins
- Bugs are resolved quickly
- Excellent integration with AJAX
Disadvantages of JQuery
- The large number of published versions in the short time. It does not matter if you are running the latest version of jQuery, you will have to host the library yourself or download the library from Google (attractive, but can bring incompatibility problems with the code).
- 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.
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.
5. Discuss the selectors and their use in jQuery.
1. Tag Name -
Represents a tag name available in the DOM. For example $('p') selects all paragraphs <p> in the document.
2.Tag ID -
Represents a tag available with the given ID in the DOM. For example $('#some-id') selects the single element in the document that has an ID of some-id.
3.Tag Class -
Represents a tag available with the given class in the DOM. For example $('.some-class') selects all elements in the document that have a class of some-class.
6. Compare and contrast the use of CSS advanced selectors in jQuery and jQuery’s DOM traversal API, indicating the pros and cons of them.
1. Adjacent Sibling Selector
- It selects all the elements that are adjacent siblings of specified elements. It selects the second element if it immediately follows the first element.
- Syntax: It select ul tags which immediately follows the h4 tag.
2. Attribute Selector
- It selects a particular type of inputs.
- Syntax:
input[type="checkbox"]{
background:orange;
}
3. nth-of-type Selector
- It selects an element from its position and types.
- Syntax: Select a particular number tag to make changes.
div:nth-of-type(5){
background:purple;
}
4. Direct Child Selector
It selects any element matching the second element that is a direct child of an element matching the first element. The element matched by the second selector must be the immediate children of the elements matched by the first selector.
Syntax: p > div {
background-color: DodgerBlue;
}
7. Explain the importance of DOM objects and DOM processing in jQuery.
Document Object Model(DOM)
- 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.
- In the DOM specification, the term "document" is used in the broad sense increasingly, XML is being used as a way of representing many different kinds of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents.
- Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data.
- With the Document Object Model, programmers can create and build documents, navigate their structure, and add, modify, or delete elements and content.
- Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions in particular, the DOM interfaces for the internal subset and external subset have not yet been specified.
- One important objective for the Document Object Model is to provide a standard programming interface that can be used in a wide variety of environments and applications.
- The Document Object Model can be used with any programming language. In order to provide precise, language-independent specification of the Document Object Model interfaces.
8. Discuss the benefits of using jQuery event handling over HTML event attributes, providing a list of events supported by jQuery.
Working with events in jQuery:
- Gives web developers a way to work with events that is much more simplified than working directly on the DOM.
- Makes different browser implementations of events a non issue via Abstraction.
- Provides web developers a nice time saving technique of binding and unbinding event handlers to one or many elements by using selectors and filters all at once.
Binding Event Handlers in jQuery
- The first event handler we usually learn in jQuery is the ready() event handler.
- We’ve talked about how events are happening all the time in our pages, and one of those events is the process of the web page actually loading.
- JavaScript uses the onload() method to check when the page has finished loading.
- It is important to know when the page is ready for interactivity so that we can begin executing any JavaScript or jQuery.
- If you try to run code before the document is ready, it will fail, and we don’t want that.
$(selector).triggerHandler(event, data)
- Triggers all bound event handlers on an element for a given event type without executing the browser default actions, bubbling, or live events.
- This event only works on the first matched element in the wrapped set.
9. Explain how to declare jQuery event handlers outside the $(document).ready() function, indicating the need for that, and the related issues and solutions for them.
- When you create a function inside $(document).ready, it's guaranteed that it won't be called before the document has loaded.
- It can only be called from that event handler itself (somewhere later in the event handler).
- In other words, what you're trying to do is valid (though not necessarily desirable - you'd have to reveal more about what you are trying to accomplish).
jQuery provides endless opportunities to customize your page using unique functions and options. This course introduces charts in jQuery as well as UI features and functions and UI autocomplete. This course also covers working with slides, the slider options, AJAX, accordion, and working with classes.
Objective
Working with Charts
- start the course
- create a doughnut chart
- create a bar chart
- create a line chart
- create a pie chart
- create a polar area chart
- create a six charts chart
UI Features and Functions
- use simple animation
- build on simple animations
- animate using UI relative values
- animate using UI predefined values
- use UI draggables
- use UI droppable
- use UI radios
- use UI checkboxes
- use UI textboxes
- use UI animated dialogs
Working with UI Autocomplete
- use UI autocomplete
- use UI autocomplete categories
- use UI autocomplete custom data and display
- use UI autocomplete multiple values
- use UI autocomplete scroll
Working with Slider
- use slider
- use slider with ranges
- use slider select
- use slider vertical and increment
Working with AJAX
- use AJAX shorthand functions
- use AJAX promises
- resolve multiple AJAX calls with when()
Working with Accordion
- use accordion events and methods
- use accordion icon and fill
- use accordion hovering and sortable
Working with Classes
- add and remove classes
- use the toggleclass function
Comments
Post a Comment