SlideShare una empresa de Scribd logo
1 de 42
Presentation On JQuery

                 Prepared
                    By
                 Rahul Jain
              Lexcis Solution
Agenda
• Basics of Jquery
• Javascript vs Jquery
• Why to use Jquery
• Concept of Jquery
• Overview of jquery API
• Jquery pros and cons
• Jquery programs
• Conclusion
What exactly is jQuery
jQuery is a JavaScript Library!


• Dealing with the DOM
• JavaScript Events
• Animations
• Ajax interactions
jQuery Basics
                     jQuery()
This function is the heart of the jQuery library
You use this function to fetch elements using CSS
selectors
and wrap them in jQuery objects so we can
manipulate
them

There’s a shorter version of the jQuery() function: $()
$("h1");
$(".important");
Document Ready

$(document).ready(function(){
// Your code here
});
jQuery has a simple statement that
checks the
document and waits until it's ready
to be manipulated
What’s the problem with
      JavaScript?
JavaScript is a weakly typed,
classless, prototype based OO
language, that can also be used
outside the browser. It is not a
        browser DOM.
It means no more of this
var tables = document.getElementsByTagName("table");
for (vart = 0; t<tables.length; t++) {
var rows = tables[t].getElementsByTagName("tr");
    for (vari = 1; i<rows.length; i += 2) {
        if (!/(^|s)odd(s|$)/.test(rows[i].className)) {
                  rows[i].className += " odd";
        }
    }
};
Using jQuery we can do this

  $("tabletr:nth-child(odd)").addClass("odd");
Using jQuery we can do this

  jQuery("tabletr:nth-child(odd)").addClass("odd");




jQuery function
Using jQuery we can do this

  jQuery("tabletr:nth-child(odd)").addClass("odd");


                  jQuery Selector (CSS expression)

jQuery function
Using jQuery we can do this

  jQuery("tabletr:nth-child(odd)").addClass("odd");



                  jQuery Selector (CSS expression)

jQuery function



      jQuery Wrapper Set
Using jQuery we can do this

  jQuery("tabletr:nth-child(odd)").addClass("odd");



                  jQuery Selector (CSS expression)

jQuery function



      jQuery Wrapper Set                jQuery Method
It really is the

“write less, do more”

 JavaScript Library!
Why use jQuery
• Helps us to simplify and speed up web
development
• Allows us to avoid common headaches
associated with browser development
• Provides a large pool of plugins
• Large and active community
• Tested on 50 browsers, 11 platforms
• Its for both coders and designers
Three Major Concepts of jQuery




 The $() function




                            Get > Act




             Chainability
The Magic $() function



      var el = $(“<div/>”)



Create HTML elements on the fly
The Magic $() function



        $(window).width()



Manipulate existing DOM elements
The Magic $() function



    $(“div”).hide();
$(“div”, $(“p”)).hide();

 Selects document elements
   (more in a moment…)
The Magic $() function

           $(function(){…});

Fired when the document is ready for
            programming.

      Better use the full syntax:

   $(document).ready(function(){…});
jQuery’s programming philosophy
               is:
          GET >> ACT

 $(“div”).hide()
 $(“<span/>”).appendTo(“body”)
 $(“:button”).click()
Almost every function returns
jQuery, which provides a fluent
  programming interface and
         chainability:


$(“div”).show()
        .addClass(“main”)
        .html(“Hello jQuery”);
Overview of jQuery API
     Core
     Selectors
     Attributes
     Traversing
     Manipulation
     CSS
     Events
     Effects
     Ajax
     Utilities
Overview of jQuery API
   Core
   Selectors
                   jQuery()
   Attributes     each()
   Traversing     map()
                   size()

   Manipulation   length
                   selector

    CSS
                   context
                  index()
                   get()
   Events
   Effects
   Ajax
   Utilities
Overview of jQuery API
   Core
   Selectors      jQuery("#nav li.contact")


   Attributes     jQuery(":visible")


    Traversing
                   jQuery(":radio:enabled:checked")

                   jQuery("a[title]")
   Manipulation
                   jQuery("a[title][href='foo']")
   CSS            jQuery("a:first[href*='foo']")
   Events         jQuery("#header, #footer")
   Effects        jQuery("#header, #footer").filter(":visible")

   Ajax
   Utilities
Overview of jQuery API
   Core
   Selectors      attr()
                   removeAttr()
   Attributes     addClass()
   Traversing     hasClass()
                   toggleClass()
   Manipulation   removeClass()

   CSS            val()

   Events
   Effects
   Ajax
   Utilities
Overview of jQuery API
   Core
   Selectors      add()
                   children()
                                eq()
                                filter()
   Attributes     closest()
                   find()
                                is()
                                not()
   Traversing     next()
                   nextAll()
                                slice()

   Manipulation   prev()
                   prevAll()
   CSS            siblings()

   Events         parent()
                   parents()
   Effects
                   andSelf()
   Ajax           end()

   Utilities
Overview of jQuery API
   Core
   Selectors      html()
                   text()
                                    replaceWith()
                                    replaceAll()
   Attributes     append()         empty()
   Traversing     appendTo()       remove()
                   prepend()
   Manipulation   prependTo()      clone()

   CSS            after()
                   insertAfter()
   Events         before()
                   insertBefore()
   Effects
    Ajax
                   wrap()
                  wrapAll()
   Utilities      wrapInner()
Overview of jQuery API
   Core
   Selectors      css()


   Attributes     offset()
                   offsetParent()
   Traversing     postion()
                   scrollTop()
   Manipulation   scrollLeft()

   CSS            height()
                   width()
   Events         innerHeight()
                   innerWidth()
   Effects        outerHeight()
                   outerWidth()
   Ajax
   Utilities
Overview of jQuery API
   Core
   Selectors      ready()            blur()
                                      change()

   Attributes     bind()
                   one()
                                      click()
                                      dbclick()

    Traversing
                   trigger()          error()
                  triggerHandler()   focus()
                   unbind()           keydown()
   Manipulation                      keypress()
                   live()             keyup()
   CSS            die()              mousedown()
                                      mousenter()
   Events         hover()
                   toggle()
                                      mouseleave()
                                      mouseout()
   Effects                           mouseup()
                                      resize()

   Ajax                              scroll()
                                      select()
                                      submit()
   Utilities                         unload()
Overview of jQuery API
   Core
   Selectors      show()
                   hide()
   Attributes     toggle()


   Traversing     slideDown()
                   slideUp()
   Manipulation   slideToggle()

   CSS            fadeIn()
                   fadeOut()
   Events         fadeTo()

   Effects        animate()
                   stop()
   Ajax
   Utilities
Overview of jQuery API
   Core
    Selectors      jQuery.ajax()        jQuery.ajaxSetup()
                  jQuery.get()         serialize()
   Attributes     jQuery.getJSON()
                   jQuery,getScript()
                                        serializeArray()


   Traversing     jQuery.post()

   Manipulation   load()

   CSS            ajaxComplete()
                   ajaxError()
   Events         ajaxSend()
                   ajaxStart()
   Effects        ajaxStop()
                   ajaxSuccess()
   Ajax
   Utilities
Overview of jQuery API
   Core
   Selectors      jQuery.support
                   jQuery.boxModel
                                         jQuery.trim()


   Attributes     jQuery.each(),
                                         jQuery.param()


   Traversing     jQuery.extend(),
                   jQuery.grep(),
   Manipulation   jQuery.makeArray(),
                   jQuery.map(),
   CSS            jQuery.inArray(),
                   jQuery.merge(),
   Events         jQuery.unique()

   Effects        jQuery.isArray(),
                   jQuery,isFunction()
   Ajax
   Utilities
A Few Examples
   Forms
   Chatboxes
   Menus
   Dropdowns
   Sliders
   Tabs
   Slideshows
   Games
jQuery Enhanced Forms
Menus and Dropdowns
Sliders and Slideshows
Technical Implementation


Building Real-Time Form Validation
Using jQuery
Pros:

• Large Community
• Ease of use
• Large library
• Strong opensource community. (Several
     jQuery plugins available)
• Great documentation and tutorials
• Ajax support
Cons:
• Regular updates that change existing behaviour
• Overhead of adding extra javascript to page
• Learning curve may not be short for some developers


Conclusions:
• Conclusion In the end, jquery is popular for a reason. It will
make your website easier to control and to access through any
browser.
• By using this library, you can create or include complex plug-
ins in a matter of minutes. This will make your website easier to
use and as long as you have imagination, the possibilities are
endless.
Thank You

Más contenido relacionado

La actualidad más candente

The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
QConLondon2008
 
Scala ActiveRecord
Scala ActiveRecordScala ActiveRecord
Scala ActiveRecord
scalaconfjp
 
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
citigroup  January 13, 2006 - Reformatted Quarterly Financial Data Supplement...citigroup  January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
QuarterlyEarningsReports
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
adamlogic
 
Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)
Joao Lucas Santana
 

La actualidad más candente (20)

Client-side MVC with Backbone.js (reloaded)
Client-side MVC with Backbone.js (reloaded)Client-side MVC with Backbone.js (reloaded)
Client-side MVC with Backbone.js (reloaded)
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and Combine
 
Prototype UI Intro
Prototype UI IntroPrototype UI Intro
Prototype UI Intro
 
The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
 
jQuery - Introdução
jQuery - IntroduçãojQuery - Introdução
jQuery - Introdução
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy Values
 
Basics of j query
Basics of j queryBasics of j query
Basics of j query
 
Jquery
JqueryJquery
Jquery
 
Getting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIGetting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUI
 
Scala ActiveRecord
Scala ActiveRecordScala ActiveRecord
Scala ActiveRecord
 
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
citigroup  January 13, 2006 - Reformatted Quarterly Financial Data Supplement...citigroup  January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
Jquery
JqueryJquery
Jquery
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
Soap tips
Soap tipsSoap tips
Soap tips
 
Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)Desenvolvimento web com Ruby on Rails (extras)
Desenvolvimento web com Ruby on Rails (extras)
 
Cassandra intro
Cassandra introCassandra intro
Cassandra intro
 

Destacado (8)

JQuery Presentation
JQuery PresentationJQuery Presentation
JQuery Presentation
 
Introduction to j query
Introduction to j queryIntroduction to j query
Introduction to j query
 
jQuery Effects
jQuery EffectsjQuery Effects
jQuery Effects
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
 
jQuery presentation
jQuery presentationjQuery presentation
jQuery presentation
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
 

Similar a JQuery

Jquery web dev workshop technocracy
Jquery web dev workshop technocracyJquery web dev workshop technocracy
Jquery web dev workshop technocracy
Amit Gupta
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
Angel Ruiz
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
rsnarayanan
 
Using jQuery to Extend CSS
Using jQuery to Extend CSSUsing jQuery to Extend CSS
Using jQuery to Extend CSS
Chris Coyier
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
Kat Roque
 
J query1.2.cheatsheet.v1.0
J query1.2.cheatsheet.v1.0J query1.2.cheatsheet.v1.0
J query1.2.cheatsheet.v1.0
Michael Grigsby
 

Similar a JQuery (20)

JQuery Overview
JQuery OverviewJQuery Overview
JQuery Overview
 
jQuery
jQueryjQuery
jQuery
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
J query training
J query trainingJ query training
J query training
 
Jquery web dev workshop technocracy
Jquery web dev workshop technocracyJquery web dev workshop technocracy
Jquery web dev workshop technocracy
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery
jQueryjQuery
jQuery
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
 
Using jQuery to Extend CSS
Using jQuery to Extend CSSUsing jQuery to Extend CSS
Using jQuery to Extend CSS
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
 
J query1.2.cheatsheet.v1.0
J query1.2.cheatsheet.v1.0J query1.2.cheatsheet.v1.0
J query1.2.cheatsheet.v1.0
 
JQUERY TUTORIAL
JQUERY TUTORIALJQUERY TUTORIAL
JQUERY TUTORIAL
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 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...
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 

JQuery

  • 1. Presentation On JQuery Prepared By Rahul Jain Lexcis Solution
  • 2. Agenda • Basics of Jquery • Javascript vs Jquery • Why to use Jquery • Concept of Jquery • Overview of jquery API • Jquery pros and cons • Jquery programs • Conclusion
  • 3. What exactly is jQuery jQuery is a JavaScript Library! • Dealing with the DOM • JavaScript Events • Animations • Ajax interactions
  • 4. jQuery Basics jQuery() This function is the heart of the jQuery library You use this function to fetch elements using CSS selectors and wrap them in jQuery objects so we can manipulate them There’s a shorter version of the jQuery() function: $() $("h1"); $(".important");
  • 5. Document Ready $(document).ready(function(){ // Your code here }); jQuery has a simple statement that checks the document and waits until it's ready to be manipulated
  • 6. What’s the problem with JavaScript?
  • 7. JavaScript is a weakly typed, classless, prototype based OO language, that can also be used outside the browser. It is not a browser DOM.
  • 8. It means no more of this var tables = document.getElementsByTagName("table"); for (vart = 0; t<tables.length; t++) { var rows = tables[t].getElementsByTagName("tr"); for (vari = 1; i<rows.length; i += 2) { if (!/(^|s)odd(s|$)/.test(rows[i].className)) { rows[i].className += " odd"; } } };
  • 9. Using jQuery we can do this $("tabletr:nth-child(odd)").addClass("odd");
  • 10. Using jQuery we can do this jQuery("tabletr:nth-child(odd)").addClass("odd"); jQuery function
  • 11. Using jQuery we can do this jQuery("tabletr:nth-child(odd)").addClass("odd"); jQuery Selector (CSS expression) jQuery function
  • 12. Using jQuery we can do this jQuery("tabletr:nth-child(odd)").addClass("odd"); jQuery Selector (CSS expression) jQuery function jQuery Wrapper Set
  • 13. Using jQuery we can do this jQuery("tabletr:nth-child(odd)").addClass("odd"); jQuery Selector (CSS expression) jQuery function jQuery Wrapper Set jQuery Method
  • 14. It really is the “write less, do more” JavaScript Library!
  • 15. Why use jQuery • Helps us to simplify and speed up web development • Allows us to avoid common headaches associated with browser development • Provides a large pool of plugins • Large and active community • Tested on 50 browsers, 11 platforms • Its for both coders and designers
  • 16. Three Major Concepts of jQuery The $() function Get > Act Chainability
  • 17. The Magic $() function var el = $(“<div/>”) Create HTML elements on the fly
  • 18. The Magic $() function $(window).width() Manipulate existing DOM elements
  • 19. The Magic $() function $(“div”).hide(); $(“div”, $(“p”)).hide(); Selects document elements (more in a moment…)
  • 20. The Magic $() function $(function(){…}); Fired when the document is ready for programming. Better use the full syntax: $(document).ready(function(){…});
  • 21. jQuery’s programming philosophy is: GET >> ACT $(“div”).hide() $(“<span/>”).appendTo(“body”) $(“:button”).click()
  • 22. Almost every function returns jQuery, which provides a fluent programming interface and chainability: $(“div”).show() .addClass(“main”) .html(“Hello jQuery”);
  • 23. Overview of jQuery API  Core  Selectors  Attributes  Traversing  Manipulation  CSS  Events  Effects  Ajax  Utilities
  • 24. Overview of jQuery API  Core  Selectors jQuery()  Attributes each()  Traversing map() size()  Manipulation length selector CSS context  index() get()  Events  Effects  Ajax  Utilities
  • 25. Overview of jQuery API  Core  Selectors jQuery("#nav li.contact")  Attributes jQuery(":visible") Traversing jQuery(":radio:enabled:checked")  jQuery("a[title]")  Manipulation jQuery("a[title][href='foo']")  CSS jQuery("a:first[href*='foo']")  Events jQuery("#header, #footer")  Effects jQuery("#header, #footer").filter(":visible")  Ajax  Utilities
  • 26. Overview of jQuery API  Core  Selectors attr() removeAttr()  Attributes addClass()  Traversing hasClass() toggleClass()  Manipulation removeClass()  CSS val()  Events  Effects  Ajax  Utilities
  • 27. Overview of jQuery API  Core  Selectors add() children() eq() filter()  Attributes closest() find() is() not()  Traversing next() nextAll() slice()  Manipulation prev() prevAll()  CSS siblings()  Events parent() parents()  Effects andSelf()  Ajax end()  Utilities
  • 28. Overview of jQuery API  Core  Selectors html() text() replaceWith() replaceAll()  Attributes append() empty()  Traversing appendTo() remove() prepend()  Manipulation prependTo() clone()  CSS after() insertAfter()  Events before() insertBefore()  Effects Ajax wrap()  wrapAll()  Utilities wrapInner()
  • 29. Overview of jQuery API  Core  Selectors css()  Attributes offset() offsetParent()  Traversing postion() scrollTop()  Manipulation scrollLeft()  CSS height() width()  Events innerHeight() innerWidth()  Effects outerHeight() outerWidth()  Ajax  Utilities
  • 30. Overview of jQuery API  Core  Selectors ready() blur() change()  Attributes bind() one() click() dbclick() Traversing trigger() error()  triggerHandler() focus() unbind() keydown()  Manipulation keypress() live() keyup()  CSS die() mousedown() mousenter()  Events hover() toggle() mouseleave() mouseout()  Effects mouseup() resize()  Ajax scroll() select() submit()  Utilities unload()
  • 31. Overview of jQuery API  Core  Selectors show() hide()  Attributes toggle()  Traversing slideDown() slideUp()  Manipulation slideToggle()  CSS fadeIn() fadeOut()  Events fadeTo()  Effects animate() stop()  Ajax  Utilities
  • 32. Overview of jQuery API  Core Selectors jQuery.ajax() jQuery.ajaxSetup()  jQuery.get() serialize()  Attributes jQuery.getJSON() jQuery,getScript() serializeArray()  Traversing jQuery.post()  Manipulation load()  CSS ajaxComplete() ajaxError()  Events ajaxSend() ajaxStart()  Effects ajaxStop() ajaxSuccess()  Ajax  Utilities
  • 33. Overview of jQuery API  Core  Selectors jQuery.support jQuery.boxModel jQuery.trim()  Attributes jQuery.each(), jQuery.param()  Traversing jQuery.extend(), jQuery.grep(),  Manipulation jQuery.makeArray(), jQuery.map(),  CSS jQuery.inArray(), jQuery.merge(),  Events jQuery.unique()  Effects jQuery.isArray(), jQuery,isFunction()  Ajax  Utilities
  • 34. A Few Examples  Forms  Chatboxes  Menus  Dropdowns  Sliders  Tabs  Slideshows  Games
  • 38. Technical Implementation Building Real-Time Form Validation Using jQuery
  • 39. Pros: • Large Community • Ease of use • Large library • Strong opensource community. (Several jQuery plugins available) • Great documentation and tutorials • Ajax support
  • 40. Cons: • Regular updates that change existing behaviour • Overhead of adding extra javascript to page • Learning curve may not be short for some developers Conclusions: • Conclusion In the end, jquery is popular for a reason. It will make your website easier to control and to access through any browser. • By using this library, you can create or include complex plug- ins in a matter of minutes. This will make your website easier to use and as long as you have imagination, the possibilities are endless.
  • 41.

Notas del editor

  1. Will add a class to each odd table row inside of each table in an html pagenot too complex, already nine lines of codelead in: using jQuery…