SlideShare uma empresa Scribd logo
1 de 19
Prepared by:
 Ahmed EL-Harouny
Senior Software Engineer
1.        What is JQuery?
2.        Referencing JQuery library
3.        Using Content Delivery Networks (CDN)
4.        Go through Documentation
5.        Using the JQuery Ready Function
6.        Basic Selectors
     1.    Select   By   Tag Name
     2.    Select   By   ID
     3.    Select   By   Class
     4.    Select   By   Attributes
7.        Dom Manipulations
     1.    Concepts
     2.    Iterate through objects
     3.    Modify properties and attributes
     4.    Create objects
     5.    Adding and Removing objects
8.    Handling Events
     1.   Binding To Events
     2.   Click Event
     3.   Change Event
     4.   Mouse Events
     5.   Unbind Events
     6.   The Live() function
jQuery is a fast JavaScript Library that simplifies HTML document
traversing, event handling, animating, and Ajax interactions for rapid web
development.

                    This means moving from this:




                                 To This:
=
1. Download the latest lib from jquery.com
2. Add Reference to it on the page
   <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>



Note: Always use minified versions of the script during runtime because you
will get significant decrease in the file size of the file.
   A CDN — short for Content Delivery Network — distributes
    static content across servers in various, physical locations.
    When a user’s browser resolves the URL for these files, their
    download will automatically target the closest available server
    in the network.
   How?
    <script src=“http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
    type="text/javascript"></script>
   When you include JQuery using a CDN service you will get the
    following benefits:
    ◦ High Availability
    ◦ Performance
    ◦ Caching
   Available free JQuery CDNs:
    ◦ Google http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
    ◦ Microsoft http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js
    ◦ JQuery http://code.jquery.com/jquery-1.7.2.min.js
http://docs.jquery.com/Main_Page
Use document ready function to execute code that depends on DOM
elements. The code you write will execute when the DOM is ready to be
traversed and manipulated.




Or use this shortcut:
When using JQuery selectors to select DOM objects; a wrapped set
(Array) is returned to you where each item in that set is a wrapper on the
native DOM object
Your awesome selectors handbook!
http://api.jquery.com/category/selectors/
   Multiple Applying
    Any manipulation function you call on a wrapped set is
    applied to all elements in the set.




   Chaining
    All manipulation functions returns the wrapper set again after
    executing its logic.
The each() function of the wrapped set:
   The attr() function
       Used to Set and Get Attributes

Get Value:




Set Value:
   Other manipulation function (mostly
    shortcuts to attr() function):
    ◦   val() getting and setting form elements values
    ◦   addClass() add class to an element
    ◦   removeClass() remove class from an element
    ◦   toggleClass() toggles a class for an element
    ◦ removeAttr() removes an attribute from an element
    ◦ hide() hides an element from the page
    ◦ show() shows an element from the page
    ◦ css() alter css for an element
   html() function
           used to get and set inner HTML of an element

Get html:




Set html:




     text() function
      used to get and set inner text of an element
      Note: when providing html tags to text function JQuery HTML-encodes
      it.
   append()    insert DOM content (parameter) to the end of the
    caller DOM element
   appendTo()    insert DOM content the caller to the end of a
    DOM element (parameter)
   prepend()     insert DOM content (parameter) to the
    beginning of the caller DOM element
   prependTo()     insert DOM content the caller to the
    beginning of a DOM element (parameter)
   remove()    removes DOM element from the DOM

Mais conteúdo relacionado

Mais procurados

Part 6 filter using table record in vb.net
Part 6 filter using table record in vb.netPart 6 filter using table record in vb.net
Part 6 filter using table record in vb.net
Girija Muscut
 
Part 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.netPart 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.net
Girija Muscut
 

Mais procurados (20)

Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
Web workers | JavaScript | HTML API
Web workers | JavaScript | HTML APIWeb workers | JavaScript | HTML API
Web workers | JavaScript | HTML API
 
React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hook
 
J Query
J QueryJ Query
J Query
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
React.js+Redux Workshops
React.js+Redux WorkshopsReact.js+Redux Workshops
React.js+Redux Workshops
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
 
Part 6 filter using table record in vb.net
Part 6 filter using table record in vb.netPart 6 filter using table record in vb.net
Part 6 filter using table record in vb.net
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4
 
iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디
 
Realm database
Realm databaseRealm database
Realm database
 
Part 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.netPart 7 navigating through recordset in vb.net
Part 7 navigating through recordset in vb.net
 
Javascript dom event
Javascript dom eventJavascript dom event
Javascript dom event
 
Guava’s Event Bus
Guava’s Event BusGuava’s Event Bus
Guava’s Event Bus
 
GreenRobot-Eventbus
GreenRobot-EventbusGreenRobot-Eventbus
GreenRobot-Eventbus
 
Html5 events
Html5 eventsHtml5 events
Html5 events
 
Infinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBus
 
Examplecode
ExamplecodeExamplecode
Examplecode
 
Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1
 
Asynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAsynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applications
 

Semelhante a Introduction to Jquery

Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdfUnit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
helenmga
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
janet736113
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
J query presentation
J query presentationJ query presentation
J query presentation
akanksha17
 
J query presentation
J query presentationJ query presentation
J query presentation
sawarkar17
 

Semelhante a Introduction to Jquery (20)

Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdfUnit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
 
J query
J queryJ query
J query
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
 
J query module1
J query module1J query module1
J query module1
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
J Query
J QueryJ Query
J Query
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
Latest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfLatest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdf
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMING
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
JavaScript: DOM and jQuery
JavaScript: DOM and jQueryJavaScript: DOM and jQuery
JavaScript: DOM and jQuery
 
J query presentation
J query presentationJ query presentation
J query presentation
 
J query presentation
J query presentationJ query presentation
J query presentation
 
jQuery
jQueryjQuery
jQuery
 
jQuery
jQueryjQuery
jQuery
 

Mais de Ahmed Elharouny

Mais de Ahmed Elharouny (7)

Deep dive into azure durable functions
Deep dive into azure durable functionsDeep dive into azure durable functions
Deep dive into azure durable functions
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front end
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
Introduction to require js
Introduction to require jsIntroduction to require js
Introduction to require js
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjs
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Design patterns
Design patternsDesign patterns
Design patterns
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer 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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Introduction to Jquery

  • 1. Prepared by: Ahmed EL-Harouny Senior Software Engineer
  • 2. 1. What is JQuery? 2. Referencing JQuery library 3. Using Content Delivery Networks (CDN) 4. Go through Documentation 5. Using the JQuery Ready Function 6. Basic Selectors 1. Select By Tag Name 2. Select By ID 3. Select By Class 4. Select By Attributes 7. Dom Manipulations 1. Concepts 2. Iterate through objects 3. Modify properties and attributes 4. Create objects 5. Adding and Removing objects
  • 3. 8. Handling Events 1. Binding To Events 2. Click Event 3. Change Event 4. Mouse Events 5. Unbind Events 6. The Live() function
  • 4. jQuery is a fast JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. This means moving from this: To This:
  • 5. =
  • 6. 1. Download the latest lib from jquery.com 2. Add Reference to it on the page <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script> Note: Always use minified versions of the script during runtime because you will get significant decrease in the file size of the file.
  • 7. A CDN — short for Content Delivery Network — distributes static content across servers in various, physical locations. When a user’s browser resolves the URL for these files, their download will automatically target the closest available server in the network.  How? <script src=“http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>  When you include JQuery using a CDN service you will get the following benefits: ◦ High Availability ◦ Performance ◦ Caching  Available free JQuery CDNs: ◦ Google http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js ◦ Microsoft http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js ◦ JQuery http://code.jquery.com/jquery-1.7.2.min.js
  • 9. Use document ready function to execute code that depends on DOM elements. The code you write will execute when the DOM is ready to be traversed and manipulated. Or use this shortcut:
  • 10. When using JQuery selectors to select DOM objects; a wrapped set (Array) is returned to you where each item in that set is a wrapper on the native DOM object
  • 11.
  • 12. Your awesome selectors handbook! http://api.jquery.com/category/selectors/
  • 13. Multiple Applying Any manipulation function you call on a wrapped set is applied to all elements in the set.  Chaining All manipulation functions returns the wrapper set again after executing its logic.
  • 14. The each() function of the wrapped set:
  • 15. The attr() function Used to Set and Get Attributes Get Value: Set Value:
  • 16. Other manipulation function (mostly shortcuts to attr() function): ◦ val() getting and setting form elements values ◦ addClass() add class to an element ◦ removeClass() remove class from an element ◦ toggleClass() toggles a class for an element ◦ removeAttr() removes an attribute from an element ◦ hide() hides an element from the page ◦ show() shows an element from the page ◦ css() alter css for an element
  • 17. html() function used to get and set inner HTML of an element Get html: Set html:  text() function used to get and set inner text of an element Note: when providing html tags to text function JQuery HTML-encodes it.
  • 18.
  • 19. append() insert DOM content (parameter) to the end of the caller DOM element  appendTo() insert DOM content the caller to the end of a DOM element (parameter)  prepend() insert DOM content (parameter) to the beginning of the caller DOM element  prependTo() insert DOM content the caller to the beginning of a DOM element (parameter)  remove() removes DOM element from the DOM