SlideShare a Scribd company logo
What is jQuery?
 jQuery is a library of JavaScript Functions.
 jQuery is a lightweight "write less, do more"
JavaScript library.
 The jQuery library contains the following features:
◦ HTML element selections
◦ HTML element manipulation
◦ CSS manipulation
◦ HTML event functions
◦ JavaScript Effects and animations
◦ HTML DOM traversal and modification
◦ AJAX
◦ Utilities
What is jQuery?
 jQuery is the most popular JavaScript framework.
 jQuery is designed to change the way that you
write JavaScript (jQuery website
http://jquery.com/)
 jQuery is a fast and concise JavaScript Library that
simplifies HTML document traversing, event
handling, animating, and Ajax interactions for
rapid web development.
What is jQuery?
 You write less code - what would take 20 lines
or more of JavaScript can be achieved in just
two or three lines of jQuery.
 The same code runs in all browsers - there's no
need to write special code for Internet Explorer.
 It uses CSS selectors, leveraging knowledge
that most web designers already have.
What is jQuery?
 jQuery is a JavaScript Library.
 jQuery greatly simplifies JavaScript
programming.
 jQuery is easy to learn.
What is jQuery?
 The jQuery library is stored as a single
JavaScript file, containing all the jQuery
methods.
 It can be added to a web page with the
following mark-up:
<head>
<script type="text/javascript"
src="jquery.js"></script>
</head>
Adding the jQuery Library to Your
Pages
 Adobe Dreamweaver has full code hinting for
jQuery, making it even easier to use.
jQuery and DreamWeaver
 jQuery Mobile (https://jquerymobile.com/)
 Backbone.js (http://backbonejs.org/)
 Node.js (https://nodejs.org/en/)
 Express.js (http://expressjs.com/en/index.html)
 Underscore.js (http://underscorejs.org/)
 AngularJS (https://angularjs.org/)
 CoffeeScript (http://coffeescript.org/)
 Prototype (http://www.prototypejs.org/)
 Dojo Toolkit (http://dojotoolkit.org/)
 Moo Tools (http://mootools.net/)
 Yahoo! UI Library (http://yuilibrary.com/)
 Adobe Spry framework (http://labs.adobe.com/technologies/spry/)
Other JavaScript Libraries
 jQuery works in all current browsers, including
Internet Explorer 6+, Firefox 2+, Safari 3+,
Chrome, and Opera 9+.
 It's free, open source code dual-licensed under
the MIT License and
GNU General Public License.
Why jQuery?
 It's estimated that three out of every four
websites that use a JavaScript library have
adopted jQuery.
 Leading companies that use jQuery include
Amazon.com, Bank of America, BBC, and
Twitter.
 It's relatively easy to learn.
Why jQuery?
 Link to the latest version of the library hosted on
a content distribution network (CDN).
 Download a copy of the library and store it with
the files in your own site.
 Details of both methods can be found at jQuery
docs (
http://docs.jquery.com/Downloading_jQuery)
How to get jQuery
<p>This paragraph is part of the original
HTML markup.</p>
<script type="text/javascript" src="js/jquery-
2.1.4.min.js"></script>
</body>
Linking to JQuery Library
<script type="text/javascript“
src="jquery.js"></script>
$(function() {
});
</script>
Document Ready Handler
Short Version
<script type="text/javascript"
src="jquery.js"></script>
$(document).ready(function(){
});
</script>
Document Ready Handler
Long Version
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>If you click on me, I will disappear.</p>
</body>
</html>
Try it yourself
Example 1
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>
Basic jQuery Example
Example 2
 Two versions of jQuery are available for
downloading: one minimalised and one
uncompressed (for debugging or reading).
 Both versions can be downloaded from
jQuery.com
Downloading jQuery
 If you don't want to store the jQuery library on
your own computer, you can use the hosted
jQuery library from Google or Microsoft.
 Google
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jq
uery/1.4.2/jquery.min.js"></script>
</head>
Alternatives to Downloading
 Microsoft
<head>
<script type="text/javascript"
src="http://ajax.microsoft.com/ajax/jque
ry/jquery-1.4.2.min.js"></script>
</head>
Alternatives to Downloading
 The jQuery syntax is tailor made for selecting HTML
elements and perform some action on the element(s).
 Basic syntax is: $(selector).action()
◦ A dollar sign to define jQuery
◦ A (selector) to "query (or find)" HTML elements
◦ A jQuery action() to be performed on the element(s)
jQuery Syntax
Examples:
 $(this).hide() - hides current element.
 $("p").hide() - hides all paragraphs
 $("p.test").hide() - hides all paragraphs with
class="test"
 $("#test").hide() - hides the element with id="test”
jQuery Syntax
 All jQuery methods are inside a document.ready()
function:
◦ $(document).ready(function(){
// jQuery functions go here...
})
 This is to prevent any jQuery code from running before
the document is finished loading (is ready).
The Document Ready Function
 Here are some examples of actions that can fail
if functions are run before the document is fully
loaded:
◦ Trying to hide an element that doesn't exist
◦ Trying to get the size of an image that is not loaded
The Document Ready Function
 jQuery selectors allow you to select and
manipulate HTML elements as a group or as a
single element.
 jQuery selectors are required at every step while
using jQuery. Selectors allow you to get the exact
element/attribute you want from your HTML
document.
 jQuery supports the existing CSS Selectors, and in
addition, it has some own custom selectors.
 All type of selectors in jQuery, start with the dollar
sign and parentheses: $().
jQuery Selectors
 $("*") selects all elements
 $("p") selects all <p> elements
 $("p.intro") selects all <p> elements with class="intro"
 $("p#intro") selects the first <p> elements with
id="intro"
 $(":animated") selects all elements that are currently
animated
 $(":button") selects all <button> elements and
<input> elements of type="button"
 $(":even") selects even elements
 $(":odd") selects odd elements
Examples of jQuery Selectors
 The jQuery event handling methods are core
functions in jQuery.
 Event handlers are methods that are called
when "something happens" in HTML. The term
"triggered (or "fired") by an event" is often
used.
 It is common to put jQuery code into event
handler methods in the <head> section:
jQuery Event Functions
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>
jQuery Event Functions
 In the example above, a function is called when
the click event for the button is triggered:
$("button").click(function() {..some code... } )
 The method hides all <p> elements:
$("p").hide();
jQuery Event Functions
 If your website contains a lot of pages, and you
want your jQuery functions to be easy to
maintain, put your jQuery functions in a
separate .js file:
<head>
<script type="text/javascript"
src="jquery.js"></script>
<script type="text/javascript"
src="my_jquery_functions.js"></script>
</head>
Functions In a Separate File

More Related Content

Similar to Jquery PPT_Finalfgfgdfgdr5tryeujkhdwappt (20)

PPTX
J111111111111111111111111111111111111111query.pptx
dkmishra2407
 
PPTX
Getting Started with jQuery
Laila Buncab
 
PPT
J query
Manav Prasad
 
PPTX
Upstate CSCI 450 jQuery
DanWooster1
 
PPTX
jQuery
Dileep Mishra
 
PPTX
Web technologies-course 11.pptx
Stefan Oprea
 
PPTX
presentation_jquery_ppt.pptx
azz71
 
PPTX
jQuery besic
Syeful Islam
 
PDF
Introduction to jQuery
Nagaraju Sangam
 
PDF
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
PPTX
How to increase Performance of Web Application using JQuery
kolkatageeks
 
PDF
jQuery Interview Questions By ScholarHat.pdf
Scholarhat
 
PPTX
J Query The Write Less Do More Javascript Library
rsnarayanan
 
PPTX
jQuery - Web Engineering
adeel990
 
PPTX
Getting started with jQuery
Gill Cleeren
 
PPT
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
J111111111111111111111111111111111111111query.pptx
dkmishra2407
 
Getting Started with jQuery
Laila Buncab
 
J query
Manav Prasad
 
Upstate CSCI 450 jQuery
DanWooster1
 
Web technologies-course 11.pptx
Stefan Oprea
 
presentation_jquery_ppt.pptx
azz71
 
jQuery besic
Syeful Islam
 
Introduction to jQuery
Nagaraju Sangam
 
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
How to increase Performance of Web Application using JQuery
kolkatageeks
 
jQuery Interview Questions By ScholarHat.pdf
Scholarhat
 
J Query The Write Less Do More Javascript Library
rsnarayanan
 
jQuery - Web Engineering
adeel990
 
Getting started with jQuery
Gill Cleeren
 
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 

More from shubhangimalas1 (8)

PPT
Section06-Syncopkojiojoijnnjkhuubgfffppt
shubhangimalas1
 
PPT
Introduction to Strutsdfkjntooijpikpdpok
shubhangimalas1
 
PPT
Servlet123jkhuiyhkjkljioyudfrtsdrestfhgb
shubhangimalas1
 
PPT
DOMhjuuihjinmkjiiuhuygfrtdxsezwasgfddggh
shubhangimalas1
 
PPT
JS-Slides-1hgvhfhgftgfvujguyghvhjbjbnnhg
shubhangimalas1
 
PPT
Internet_PPt.ppthgjgkjhkjhkhjhuuuuihjnnn
shubhangimalas1
 
PPTX
Unit 1 ppt os jkhiutufyhfhtjdtrsdcjgnhb,
shubhangimalas1
 
PPTX
Unit I Fundamental Concepts of Operating system.pptx
shubhangimalas1
 
Section06-Syncopkojiojoijnnjkhuubgfffppt
shubhangimalas1
 
Introduction to Strutsdfkjntooijpikpdpok
shubhangimalas1
 
Servlet123jkhuiyhkjkljioyudfrtsdrestfhgb
shubhangimalas1
 
DOMhjuuihjinmkjiiuhuygfrtdxsezwasgfddggh
shubhangimalas1
 
JS-Slides-1hgvhfhgftgfvujguyghvhjbjbnnhg
shubhangimalas1
 
Internet_PPt.ppthgjgkjhkjhkhjhuuuuihjnnn
shubhangimalas1
 
Unit 1 ppt os jkhiutufyhfhtjdtrsdcjgnhb,
shubhangimalas1
 
Unit I Fundamental Concepts of Operating system.pptx
shubhangimalas1
 
Ad

Recently uploaded (20)

PDF
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
PPTX
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PPTX
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PDF
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
Thermal runway and thermal stability.pptx
godow93766
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
Hashing Introduction , hash functions and techniques
sailajam21
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Ad

Jquery PPT_Finalfgfgdfgdr5tryeujkhdwappt

  • 2.  jQuery is a library of JavaScript Functions.  jQuery is a lightweight "write less, do more" JavaScript library.  The jQuery library contains the following features: ◦ HTML element selections ◦ HTML element manipulation ◦ CSS manipulation ◦ HTML event functions ◦ JavaScript Effects and animations ◦ HTML DOM traversal and modification ◦ AJAX ◦ Utilities What is jQuery?
  • 3.  jQuery is the most popular JavaScript framework.  jQuery is designed to change the way that you write JavaScript (jQuery website http://jquery.com/)  jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. What is jQuery?
  • 4.  You write less code - what would take 20 lines or more of JavaScript can be achieved in just two or three lines of jQuery.  The same code runs in all browsers - there's no need to write special code for Internet Explorer.  It uses CSS selectors, leveraging knowledge that most web designers already have. What is jQuery?
  • 5.  jQuery is a JavaScript Library.  jQuery greatly simplifies JavaScript programming.  jQuery is easy to learn. What is jQuery?
  • 6.  The jQuery library is stored as a single JavaScript file, containing all the jQuery methods.  It can be added to a web page with the following mark-up: <head> <script type="text/javascript" src="jquery.js"></script> </head> Adding the jQuery Library to Your Pages
  • 7.  Adobe Dreamweaver has full code hinting for jQuery, making it even easier to use. jQuery and DreamWeaver
  • 8.  jQuery Mobile (https://jquerymobile.com/)  Backbone.js (http://backbonejs.org/)  Node.js (https://nodejs.org/en/)  Express.js (http://expressjs.com/en/index.html)  Underscore.js (http://underscorejs.org/)  AngularJS (https://angularjs.org/)  CoffeeScript (http://coffeescript.org/)  Prototype (http://www.prototypejs.org/)  Dojo Toolkit (http://dojotoolkit.org/)  Moo Tools (http://mootools.net/)  Yahoo! UI Library (http://yuilibrary.com/)  Adobe Spry framework (http://labs.adobe.com/technologies/spry/) Other JavaScript Libraries
  • 9.  jQuery works in all current browsers, including Internet Explorer 6+, Firefox 2+, Safari 3+, Chrome, and Opera 9+.  It's free, open source code dual-licensed under the MIT License and GNU General Public License. Why jQuery?
  • 10.  It's estimated that three out of every four websites that use a JavaScript library have adopted jQuery.  Leading companies that use jQuery include Amazon.com, Bank of America, BBC, and Twitter.  It's relatively easy to learn. Why jQuery?
  • 11.  Link to the latest version of the library hosted on a content distribution network (CDN).  Download a copy of the library and store it with the files in your own site.  Details of both methods can be found at jQuery docs ( http://docs.jquery.com/Downloading_jQuery) How to get jQuery
  • 12. <p>This paragraph is part of the original HTML markup.</p> <script type="text/javascript" src="js/jquery- 2.1.4.min.js"></script> </body> Linking to JQuery Library
  • 15. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }); }); </script> </head> <body> <p>If you click on me, I will disappear.</p> </body> </html> Try it yourself Example 1
  • 16. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html> Basic jQuery Example Example 2
  • 17.  Two versions of jQuery are available for downloading: one minimalised and one uncompressed (for debugging or reading).  Both versions can be downloaded from jQuery.com Downloading jQuery
  • 18.  If you don't want to store the jQuery library on your own computer, you can use the hosted jQuery library from Google or Microsoft.  Google <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jq uery/1.4.2/jquery.min.js"></script> </head> Alternatives to Downloading
  • 20.  The jQuery syntax is tailor made for selecting HTML elements and perform some action on the element(s).  Basic syntax is: $(selector).action() ◦ A dollar sign to define jQuery ◦ A (selector) to "query (or find)" HTML elements ◦ A jQuery action() to be performed on the element(s) jQuery Syntax
  • 21. Examples:  $(this).hide() - hides current element.  $("p").hide() - hides all paragraphs  $("p.test").hide() - hides all paragraphs with class="test"  $("#test").hide() - hides the element with id="test” jQuery Syntax
  • 22.  All jQuery methods are inside a document.ready() function: ◦ $(document).ready(function(){ // jQuery functions go here... })  This is to prevent any jQuery code from running before the document is finished loading (is ready). The Document Ready Function
  • 23.  Here are some examples of actions that can fail if functions are run before the document is fully loaded: ◦ Trying to hide an element that doesn't exist ◦ Trying to get the size of an image that is not loaded The Document Ready Function
  • 24.  jQuery selectors allow you to select and manipulate HTML elements as a group or as a single element.  jQuery selectors are required at every step while using jQuery. Selectors allow you to get the exact element/attribute you want from your HTML document.  jQuery supports the existing CSS Selectors, and in addition, it has some own custom selectors.  All type of selectors in jQuery, start with the dollar sign and parentheses: $(). jQuery Selectors
  • 25.  $("*") selects all elements  $("p") selects all <p> elements  $("p.intro") selects all <p> elements with class="intro"  $("p#intro") selects the first <p> elements with id="intro"  $(":animated") selects all elements that are currently animated  $(":button") selects all <button> elements and <input> elements of type="button"  $(":even") selects even elements  $(":odd") selects odd elements Examples of jQuery Selectors
  • 26.  The jQuery event handling methods are core functions in jQuery.  Event handlers are methods that are called when "something happens" in HTML. The term "triggered (or "fired") by an event" is often used.  It is common to put jQuery code into event handler methods in the <head> section: jQuery Event Functions
  • 27. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html> jQuery Event Functions
  • 28.  In the example above, a function is called when the click event for the button is triggered: $("button").click(function() {..some code... } )  The method hides all <p> elements: $("p").hide(); jQuery Event Functions
  • 29.  If your website contains a lot of pages, and you want your jQuery functions to be easy to maintain, put your jQuery functions in a separate .js file: <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="my_jquery_functions.js"></script> </head> Functions In a Separate File