SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
M o d u l e - 1
I n t r o d u c i n g j Q u e r y
www.edureka.co/jquery-ui-development
Objectives
Slide 2 www.edureka.co/jquery-ui-development
By the end of this module, you will be able to understand:
Introduction to jQuery & History
The jQuery Object($)
Basic DOM HTML Document/Page Types
CSS Selectors
IDE's for jQuery, jQuery CDN & Installation
jQuery Functions, Selectors, Querying DOM, Traversing the DOM
jQuery Selectors, jQuery Basic Functions, DOM Traversing
Intro to HTML, CSS &JS
HTML (Hyper Text Markup Language): It is markup language for talking with web browsers which used to
develop web pages
CSS (Cascading Style Sheets): It is a style sheet to format your language look and feel, which is used to design
your web pages
JS (JavaScript): It is a scripting language to add interaction to you web pages
JavaScript (Behavioral)
CSS (Presentational)
HTML (Structural)
Slide 3 www.edureka.co/jquery-ui-development
Basic DOMStructure
<!DOCTYPE html> <html>
<head>
<title>jQuery Training</title>
</head>
<body>
<h1>jQueryIntro</h1>
<p>Plan your jQuery TrainingNow</p>
<ul>
<li>I am a list item in HTML</li>
<li>I am also a list item</li>
</ul>
</body></html>
DOCUMENT
html
title
jQuery Training
body
h1
jQuery Intro…
p
Plan your…
head
Slide 4 www.edureka.co/jquery-ui-development
http://jsfiddle.net/avinay/weq70hbL/2/
DOM Scripting
JavaScript is a scripting language to interact with the DOM
Unobtrusive
Based on web standards
Browsers behave differently
Slide 5 www.edureka.co/jquery-ui-development
DOM Scripting (Contd.)
Each browser has a slightly different DOM interface
Slide 6 www.edureka.co/jquery-ui-development
DOM Scripting (Contd.)
Slide 7 www.edureka.co/jquery-ui-development
Intro to jQuery & History
Slide 8 www.edureka.co/jquery-ui-development
A fast, concise, JavaScript library that simplifies how to traverse HTML documents, handle events, perform
animations, and AJAX for web development
jQuery has changed the way that millions of people write JavaScript
» It is a free and open source JavaScript library, first released in 2006
» Most popular, cross-browser support
» Lightweight
» Improves developer efficiency
» Easy to learn using familiar CSS syntax and intuitive
» Current release is 1.9 and 2.1
Why jQuery
Slide 9 www.edureka.co/jquery-ui-development
jQuery is a JavaScript library designed to simplify the client-side scripting of HTML
 jQuery helps to create powerful dynamic web pages and web applications
 Is intuitive and easy to learn
 It integrates with Visual studio IDE with ease
 Helps in loading pages faster and is SEO friendly
 Helps in creating animated pages like flash
Document Type in HTML is a DOCTYPE, this informs the validator which version of (X)HTML you’re using, and
it must appear at the very beginning of every web page
DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate withoutthem
HTML4/XHTML1.0 – DOCTYPE
HTML5 – DOCTYPE
<!DOCTYPE html>
HTML DocumentTypes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
Slide 10 www.edureka.co/jquery-ui-development
CSS Selectors
Slide 11 www.edureka.co/jquery-ui-development
Selectors are used to select an element based on names, attribute, position
» TagName Selectors
» ID Selectors
» Class Selectors
» Pseudo-classes Selectors
» Selectors based on relationships
» Attribute Selectors
» Multiple Selectors
The jQuery Object($)
Slide 12 www.edureka.co/jquery-ui-development
jQuery(<code>): It is a jQueryFunction
$(<code>): Is also an alternative name of jQuery function
$(document): jQuery function usually takes a single argument, in this example “document”
A jQuery Object is like an array, which contains zero or more indexes. It also contains object methods like:
» Length
» Context
» Selector
IDE’s for jQuery
Editors
• Sublime Text2
• Atom
• Dreamweaver
• Browser console etc.
Online Editors
• Jsfiddle
• Jsbin
• Cloud 9
Debuggers
• Firebug
Slide 13 www.edureka.co/jquery-ui-development
• Chrome Web Inspector
jQuery CDN & Installation
Slide 14 www.edureka.co/jquery-ui-development
There are different ways of installing jQuery into you web project
Download from www.jquery.com and include in the web page using <script>
» <script type="text/javascript" src=”/dir/1.9.1/jquery.min.js"></script>
Including reference to jQuery library file using CDN (Content Delivery Network)
» <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
» A benefit of using a CDN hosted version is that it is reliable, fast, and potentially cached
Minified & Full Source Code versions
jQuery Functions
$(document).ready(): This is called DocumentReady, which is executed as soon as the document is ready for
DOM manipulation
We assign our function to the ready event, to tell jQuery that as soon as the document is ready, we want it to
call our function
» E.g.
Slide 15 www.edureka.co/jquery-ui-development
jQuery Functions (Contd.)
jQuery function Chaining: Chaining is one of the most powerful feature of jQuery where it can perform multiple
methods on the same set of elements, it saves us and the browser from having to find the same elements more
than once
» E.g.
Slide 16 www.edureka.co/jquery-ui-development
jQuery Functions (Contd.)
Custom Functions: There are several different ways to declare functions using JavaScript/jQuery
» Basic Function Declaration:
» Custom jQueryFunction:
Slide 17 www.edureka.co/jquery-ui-development
Querying DOM
Selecting one or more elements from your document object model (DOM) to work with them
In jQuery we query the DOM using the CSS selectors
<ul id=“fruits”>
<li>Orange</li>
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
</ul>
<script>
$(document).ready(function()
{
$(“#fruits”).text();
$(“#ul#fruits”).text();
$(“#ul”).text();
$(“#fruits li”).text();
console.log($(#fruits”));
});
</scriptl>
Slide 18 www.edureka.co/jquery-ui-development
jQuery Selectors
A jQuery Selector is a function which uses power of Cascading Style Sheets (CSS) selectors find out matching
elements from a DOM
jQuery Selectors let us quickly and easily access HTML elements or groups of elements
Types of Selectors:
» ID Selectors: This uses the ID attribute of a HTML tag to select the desired element from DOM. An ID
should be unique, so you should only use this selector when you want to select a single and unique
element
»E.g.
Slide 19 www.edureka.co/jquery-ui-development
jQuery Selectors (Contd.)
Class Selectors: This uses class attribute to select elements with a specific class can be matched by writing a
character followed by the name of the class
»E.g.
Slide 20 www.edureka.co/jquery-ui-development
jQuery Selectors (Contd.)
Element Selectors: This type uses HTML tags to select required elements. It is best practice to use tag name
before using class selector. it's also faster for jQuery to process
» E.g.
Slide 21 www.edureka.co/jquery-ui-development
jQuery Selectors (Contd.)
Attribute Selectors: With this you can select elements using elements attribute
» E.g.
Universal Selectors
» E.g.
Slide 22 www.edureka.co/jquery-ui-development
jQuery Selectors (Contd.)
Position Selectors & Psuedo-classes Selectors:
» E.g.
Slide 23 www.edureka.co/jquery-ui-development
Traversing the DOM
Slide 24 www.edureka.co/jquery-ui-development
In jQuery, “Traversing” lets us to move through the DOM/HTML Elements in the web page
With “Query Selectors” we make initial selection then move using Traversing functions
Having a strong command of the most common traversal functions will speed up your development time
Most Commons functions:
»find(): Finds all matching elements
» children(): It is same as find, but moves only onelevel down
» closest(): moves up the DOM tree, until it finds the matching element
» parent(): parent also moves up the DOM tree but to a single level
» next(): moves down and targets the immediately following sibling
» prev(): moves just like .next(), but moves up, targeting the immediately preceding sibling
» siblings(): It targets move up and down, targeting all siblings
» first(): Gets the first elements from the selected set
» last(): Gets the last element from the selected set
Traversing the DOM (Contd.)
 find(): This function finds all matching elements from the DOM
» E.g.
Children(): It is same as find, but moves only one level down
» E.g.
Slide 25 www.edureka.co/jquery-ui-development
Traversing the DOM (Contd.)
closest(): moves up the DOM tree, until it finds the matching element in the DOM
» E.g.
parent(): parent also moves up the DOM tree but to a single level
» E.g.
Slide 26 www.edureka.co/jquery-ui-development
Traversing the DOM (Contd.)
next(): moves down and targets the immediately following sibling
» E.g.
prev(): moves just like .next(), but moves up, targeting the immediately preceding sibling
» E.g.
Slide 27 www.edureka.co/jquery-ui-development
Traversing the DOM (Contd.)
siblings(): It targets move up and down, targeting all siblings
» E.g.
first(): Gets the first elements from the selected set
» E.g.
last(): Gets the last element from the selected set
» E.g.
Slide 28 www.edureka.co/jquery-ui-development
LAB
Slide 29 www.edureka.co/jquery-ui-development
Hello There!!
My name is Annie.
I love quizzes and
puzzles and I am here to
make you guys think and
answer my questions.
Annie’s Introduction
Slide 30 www.edureka.co/jquery-ui-development
Annie’s Question
Question: What is $ in jQuery? And why it is used?
Slide 31 www.edureka.co/jquery-ui-development
Annie’s Answer
AQnusewsteior:n
» In jQuery the $ is simply a function and alias for the
function called jQuery
» It is used in different scenarios depending on what
arguments it is passed
Slide 32 www.edureka.co/jquery-ui-development
Assignment
Slide 33 www.edureka.co/jquery-ui-development
Create a webpage with anchor links and form fields and use jQuery selectors to add some styling dynamically
Try to use Below Selectors:
1. Tag Selector
2. Attribute Selector
3. Class selector
Pre-work for Next Module
Slide 34 www.edureka.co/jquery-ui-development
Learn basics of jQuery Filters and jQuery Effects
Agenda for Next Module
Slide 35 www.edureka.co/jquery-ui-development
In the next module, you will be able to understand
Adding and Removing DOM elements
 Iterating with each(), DOM elements
 Modifying Properties andAttributes
jQuery Filters
 jQuery Effects, hide/show, fading methods, chaining
Animate Function
Q u est io n s
Slide 36 www.edureka.co/jquery-ui-development
Your feedback is important to us, be it a compliment, a suggestion or a complaint. It helps us to make
the course better!
Please spare few seconds to take the survey after the webinar.
Survey
Slide 37 www.edureka.co/jquery-ui-development
Introduction to jQuery

Contenu connexe

Plus de Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

Plus de Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Dernier

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Introduction to jQuery

  • 1. M o d u l e - 1 I n t r o d u c i n g j Q u e r y www.edureka.co/jquery-ui-development
  • 2. Objectives Slide 2 www.edureka.co/jquery-ui-development By the end of this module, you will be able to understand: Introduction to jQuery & History The jQuery Object($) Basic DOM HTML Document/Page Types CSS Selectors IDE's for jQuery, jQuery CDN & Installation jQuery Functions, Selectors, Querying DOM, Traversing the DOM jQuery Selectors, jQuery Basic Functions, DOM Traversing
  • 3. Intro to HTML, CSS &JS HTML (Hyper Text Markup Language): It is markup language for talking with web browsers which used to develop web pages CSS (Cascading Style Sheets): It is a style sheet to format your language look and feel, which is used to design your web pages JS (JavaScript): It is a scripting language to add interaction to you web pages JavaScript (Behavioral) CSS (Presentational) HTML (Structural) Slide 3 www.edureka.co/jquery-ui-development
  • 4. Basic DOMStructure <!DOCTYPE html> <html> <head> <title>jQuery Training</title> </head> <body> <h1>jQueryIntro</h1> <p>Plan your jQuery TrainingNow</p> <ul> <li>I am a list item in HTML</li> <li>I am also a list item</li> </ul> </body></html> DOCUMENT html title jQuery Training body h1 jQuery Intro… p Plan your… head Slide 4 www.edureka.co/jquery-ui-development
  • 5. http://jsfiddle.net/avinay/weq70hbL/2/ DOM Scripting JavaScript is a scripting language to interact with the DOM Unobtrusive Based on web standards Browsers behave differently Slide 5 www.edureka.co/jquery-ui-development
  • 6. DOM Scripting (Contd.) Each browser has a slightly different DOM interface Slide 6 www.edureka.co/jquery-ui-development
  • 7. DOM Scripting (Contd.) Slide 7 www.edureka.co/jquery-ui-development
  • 8. Intro to jQuery & History Slide 8 www.edureka.co/jquery-ui-development A fast, concise, JavaScript library that simplifies how to traverse HTML documents, handle events, perform animations, and AJAX for web development jQuery has changed the way that millions of people write JavaScript » It is a free and open source JavaScript library, first released in 2006 » Most popular, cross-browser support » Lightweight » Improves developer efficiency » Easy to learn using familiar CSS syntax and intuitive » Current release is 1.9 and 2.1
  • 9. Why jQuery Slide 9 www.edureka.co/jquery-ui-development jQuery is a JavaScript library designed to simplify the client-side scripting of HTML  jQuery helps to create powerful dynamic web pages and web applications  Is intuitive and easy to learn  It integrates with Visual studio IDE with ease  Helps in loading pages faster and is SEO friendly  Helps in creating animated pages like flash
  • 10. Document Type in HTML is a DOCTYPE, this informs the validator which version of (X)HTML you’re using, and it must appear at the very beginning of every web page DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate withoutthem HTML4/XHTML1.0 – DOCTYPE HTML5 – DOCTYPE <!DOCTYPE html> HTML DocumentTypes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> Slide 10 www.edureka.co/jquery-ui-development
  • 11. CSS Selectors Slide 11 www.edureka.co/jquery-ui-development Selectors are used to select an element based on names, attribute, position » TagName Selectors » ID Selectors » Class Selectors » Pseudo-classes Selectors » Selectors based on relationships » Attribute Selectors » Multiple Selectors
  • 12. The jQuery Object($) Slide 12 www.edureka.co/jquery-ui-development jQuery(<code>): It is a jQueryFunction $(<code>): Is also an alternative name of jQuery function $(document): jQuery function usually takes a single argument, in this example “document” A jQuery Object is like an array, which contains zero or more indexes. It also contains object methods like: » Length » Context » Selector
  • 13. IDE’s for jQuery Editors • Sublime Text2 • Atom • Dreamweaver • Browser console etc. Online Editors • Jsfiddle • Jsbin • Cloud 9 Debuggers • Firebug Slide 13 www.edureka.co/jquery-ui-development • Chrome Web Inspector
  • 14. jQuery CDN & Installation Slide 14 www.edureka.co/jquery-ui-development There are different ways of installing jQuery into you web project Download from www.jquery.com and include in the web page using <script> » <script type="text/javascript" src=”/dir/1.9.1/jquery.min.js"></script> Including reference to jQuery library file using CDN (Content Delivery Network) » <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> » A benefit of using a CDN hosted version is that it is reliable, fast, and potentially cached Minified & Full Source Code versions
  • 15. jQuery Functions $(document).ready(): This is called DocumentReady, which is executed as soon as the document is ready for DOM manipulation We assign our function to the ready event, to tell jQuery that as soon as the document is ready, we want it to call our function » E.g. Slide 15 www.edureka.co/jquery-ui-development
  • 16. jQuery Functions (Contd.) jQuery function Chaining: Chaining is one of the most powerful feature of jQuery where it can perform multiple methods on the same set of elements, it saves us and the browser from having to find the same elements more than once » E.g. Slide 16 www.edureka.co/jquery-ui-development
  • 17. jQuery Functions (Contd.) Custom Functions: There are several different ways to declare functions using JavaScript/jQuery » Basic Function Declaration: » Custom jQueryFunction: Slide 17 www.edureka.co/jquery-ui-development
  • 18. Querying DOM Selecting one or more elements from your document object model (DOM) to work with them In jQuery we query the DOM using the CSS selectors <ul id=“fruits”> <li>Orange</li> <li>Apple</li> <li>Banana</li> <li>Grapes</li> </ul> <script> $(document).ready(function() { $(“#fruits”).text(); $(“#ul#fruits”).text(); $(“#ul”).text(); $(“#fruits li”).text(); console.log($(#fruits”)); }); </scriptl> Slide 18 www.edureka.co/jquery-ui-development
  • 19. jQuery Selectors A jQuery Selector is a function which uses power of Cascading Style Sheets (CSS) selectors find out matching elements from a DOM jQuery Selectors let us quickly and easily access HTML elements or groups of elements Types of Selectors: » ID Selectors: This uses the ID attribute of a HTML tag to select the desired element from DOM. An ID should be unique, so you should only use this selector when you want to select a single and unique element »E.g. Slide 19 www.edureka.co/jquery-ui-development
  • 20. jQuery Selectors (Contd.) Class Selectors: This uses class attribute to select elements with a specific class can be matched by writing a character followed by the name of the class »E.g. Slide 20 www.edureka.co/jquery-ui-development
  • 21. jQuery Selectors (Contd.) Element Selectors: This type uses HTML tags to select required elements. It is best practice to use tag name before using class selector. it's also faster for jQuery to process » E.g. Slide 21 www.edureka.co/jquery-ui-development
  • 22. jQuery Selectors (Contd.) Attribute Selectors: With this you can select elements using elements attribute » E.g. Universal Selectors » E.g. Slide 22 www.edureka.co/jquery-ui-development
  • 23. jQuery Selectors (Contd.) Position Selectors & Psuedo-classes Selectors: » E.g. Slide 23 www.edureka.co/jquery-ui-development
  • 24. Traversing the DOM Slide 24 www.edureka.co/jquery-ui-development In jQuery, “Traversing” lets us to move through the DOM/HTML Elements in the web page With “Query Selectors” we make initial selection then move using Traversing functions Having a strong command of the most common traversal functions will speed up your development time Most Commons functions: »find(): Finds all matching elements » children(): It is same as find, but moves only onelevel down » closest(): moves up the DOM tree, until it finds the matching element » parent(): parent also moves up the DOM tree but to a single level » next(): moves down and targets the immediately following sibling » prev(): moves just like .next(), but moves up, targeting the immediately preceding sibling » siblings(): It targets move up and down, targeting all siblings » first(): Gets the first elements from the selected set » last(): Gets the last element from the selected set
  • 25. Traversing the DOM (Contd.)  find(): This function finds all matching elements from the DOM » E.g. Children(): It is same as find, but moves only one level down » E.g. Slide 25 www.edureka.co/jquery-ui-development
  • 26. Traversing the DOM (Contd.) closest(): moves up the DOM tree, until it finds the matching element in the DOM » E.g. parent(): parent also moves up the DOM tree but to a single level » E.g. Slide 26 www.edureka.co/jquery-ui-development
  • 27. Traversing the DOM (Contd.) next(): moves down and targets the immediately following sibling » E.g. prev(): moves just like .next(), but moves up, targeting the immediately preceding sibling » E.g. Slide 27 www.edureka.co/jquery-ui-development
  • 28. Traversing the DOM (Contd.) siblings(): It targets move up and down, targeting all siblings » E.g. first(): Gets the first elements from the selected set » E.g. last(): Gets the last element from the selected set » E.g. Slide 28 www.edureka.co/jquery-ui-development
  • 30. Hello There!! My name is Annie. I love quizzes and puzzles and I am here to make you guys think and answer my questions. Annie’s Introduction Slide 30 www.edureka.co/jquery-ui-development
  • 31. Annie’s Question Question: What is $ in jQuery? And why it is used? Slide 31 www.edureka.co/jquery-ui-development
  • 32. Annie’s Answer AQnusewsteior:n » In jQuery the $ is simply a function and alias for the function called jQuery » It is used in different scenarios depending on what arguments it is passed Slide 32 www.edureka.co/jquery-ui-development
  • 33. Assignment Slide 33 www.edureka.co/jquery-ui-development Create a webpage with anchor links and form fields and use jQuery selectors to add some styling dynamically Try to use Below Selectors: 1. Tag Selector 2. Attribute Selector 3. Class selector
  • 34. Pre-work for Next Module Slide 34 www.edureka.co/jquery-ui-development Learn basics of jQuery Filters and jQuery Effects
  • 35. Agenda for Next Module Slide 35 www.edureka.co/jquery-ui-development In the next module, you will be able to understand Adding and Removing DOM elements  Iterating with each(), DOM elements  Modifying Properties andAttributes jQuery Filters  jQuery Effects, hide/show, fading methods, chaining Animate Function
  • 36. Q u est io n s Slide 36 www.edureka.co/jquery-ui-development
  • 37. Your feedback is important to us, be it a compliment, a suggestion or a complaint. It helps us to make the course better! Please spare few seconds to take the survey after the webinar. Survey Slide 37 www.edureka.co/jquery-ui-development