SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
introduction
                 to
                 jQuery
              Garrett Johnson // CharlotteJS // 8-19-2010




Friday, August 20, 2010
Me?
                Jr. Web Developer at Red Ventures
                Student
                I will program in just about anything.
                Started this joint! (with a lot of help from Nathan and
                Aaron)




Friday, August 20, 2010
jQuery
                Seriously?
                "jQuery is a fast and concise JavaScript Library that
                simplifies HTML document traversing, event handling,
                animating, and Ajax interactions for rapid web
                development."




Friday, August 20, 2010
jQuery

                          selectors    manipulation   effects



                          attributes       css         ajax



                          traversing     events       utilities

Friday, August 20, 2010
Lets Get It



                   A quick tour with some stops on the way. Feel free to
                                 stop and start discussion.




Friday, August 20, 2010
document.ready?
                just an event.*
                gets triggered once the DOM is parsed/loaded.
                use as much as you want.*
                just put your <script></script> prior to </body> or right
                below the desired element.
                      DOM is ready at this point.
                      portability?*


Friday, August 20, 2010
document.ready?
                      1.html




Friday, August 20, 2010
selectors

                          node type   descendants    attributes



                             id          child      expressions*



                     class name        multiples       more

Friday, August 20, 2010
selectors
                      2.html




Friday, August 20, 2010
selectors
                      cache selectors
                      selector context
                      find()
                      exact on the left, general on the right.
                      avoid pure class or node selectors
                      keep it simple!




Friday, August 20, 2010
selectors
                      3.html




Friday, August 20, 2010
wait... what the $
                      $ === jQuery
                      $() is a factory.*
                      returns “array like” collection of “jQuery” objects.
                      not just css selectors.
                          raw elements.*
                          html.*




Friday, August 20, 2010
wait... what the $
                      4.html




Friday, August 20, 2010
manipulation

                          append    html     detach



                          prepend   filter    each



                            val     *class   more

Friday, August 20, 2010
manipulation
                      5.html




Friday, August 20, 2010
traversing

                          parents     next      attributes



                          children   siblings      *all



                           prev        find        more

Friday, August 20, 2010
traversing
                      6.html




Friday, August 20, 2010
traversing / manipulation
                      once you found it. do something.
                      tons more features for traversing and manipulation.
                      the docs are awesome.




Friday, August 20, 2010
events

                          binding     proxy       shorthands*



                          custom       live        delegate



                   namespaces       delegation*      more

Friday, August 20, 2010
events
                      find something. bind it.
                      $(‘.foo’).bind(‘click’, fn);
                      $(‘.foo’).click(fn);
                      $(‘.foo’).live(‘click’, fn);
                      $(‘#bar’).delegate(‘.foo’, ‘click’, fn)*




Friday, August 20, 2010
events
                      7.html




Friday, August 20, 2010
events
                      bubbling.
                      delegating.
                      lower memory foot print.
                      performance++




Friday, August 20, 2010
events
                      8.html




Friday, August 20, 2010
events
                      event.data
                      clean up that repetitive code.
                      binding time.*




Friday, August 20, 2010
events
                      9.html




Friday, August 20, 2010
events
                      custom events
                      clean up that repetitive code.**
                      trigger time.




Friday, August 20, 2010
events
                      10.html




Friday, August 20, 2010
effects

                           hide     slide    fadeOut



                           show     toggle   delays



                          animate   fadeIn    more

Friday, August 20, 2010
effects
                      nifty....




Friday, August 20, 2010
ajax

                          get    getJSON     ajaxSetup



                          post     ajax       events*



                          load   getScript     more

Friday, August 20, 2010
ajax
                      shorthand methods
                      the core ajax method
                      default configuration
                      events
                          global
                          local




Friday, August 20, 2010
ajax
                      12.html




Friday, August 20, 2010
extending
                          plugins
                          expressions




Friday, August 20, 2010
extending
                      13.html




Friday, August 20, 2010
what else?
                          questions?
                          favorite plugins?
                          problems?




Friday, August 20, 2010
peace!
                          gtalk: gjj391
                          aim: gjohnson391
                          pdf/code will be on github.com/gjohnson




Friday, August 20, 2010

Weitere ähnliche Inhalte

Ähnlich wie Introduction to jQuery :: CharlotteJS

dojo is bizarro jQuery
dojo is bizarro jQuerydojo is bizarro jQuery
dojo is bizarro jQueryJohn Hann
 
The Tech Side of Project Argo
The Tech Side of Project ArgoThe Tech Side of Project Argo
The Tech Side of Project ArgoWesley Lindamood
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonJen Simmons
 
谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010Zi Bin Cheah
 
Mobile Cross Platform
Mobile Cross PlatformMobile Cross Platform
Mobile Cross PlatformNikolai Onken
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Zi Bin Cheah
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Bastian Hofmann
 
Sharing content between hippo and solr
Sharing content between hippo and solrSharing content between hippo and solr
Sharing content between hippo and solrJettro Coenradie
 
Human APIs - expanding the mobile web or are robots coming to JavaScript?
Human APIs - expanding the mobile web or are robots coming to JavaScript? Human APIs - expanding the mobile web or are robots coming to JavaScript?
Human APIs - expanding the mobile web or are robots coming to JavaScript? Nikolai Onken
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End OptimizationsScott Taylor
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Adam Baldwin
 
5 分でキメル! (慣れれば、あなたもやれる!) たったの 5 分でできるサーバと通信できる iPhone アプリの作成
5 分でキメル!  (慣れれば、あなたもやれる!)  たったの 5 分でできるサーバと通信できる iPhone アプリの作成5 分でキメル!  (慣れれば、あなたもやれる!)  たったの 5 分でできるサーバと通信できる iPhone アプリの作成
5 分でキメル! (慣れれば、あなたもやれる!) たったの 5 分でできるサーバと通信できる iPhone アプリの作成Takafumi Kawano
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Adrian Olaru
 
HTML5 Apps - Cross platform
HTML5 Apps - Cross platformHTML5 Apps - Cross platform
HTML5 Apps - Cross platformwolframkriesing
 
Document-Oriented Databases: Couchdb Primer
Document-Oriented Databases: Couchdb PrimerDocument-Oriented Databases: Couchdb Primer
Document-Oriented Databases: Couchdb Primerjsiarto
 
AlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueilsAlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueilsjulien.ponge
 
MongoDB on Rails (and Ruby)
MongoDB on Rails (and Ruby)MongoDB on Rails (and Ruby)
MongoDB on Rails (and Ruby)jan_mindmatters
 
Websockets, Ruby y Pusher Webprendedor 2010
Websockets, Ruby y Pusher Webprendedor 2010Websockets, Ruby y Pusher Webprendedor 2010
Websockets, Ruby y Pusher Webprendedor 2010Ismael Celis
 

Ähnlich wie Introduction to jQuery :: CharlotteJS (20)

dojo is bizarro jQuery
dojo is bizarro jQuerydojo is bizarro jQuery
dojo is bizarro jQuery
 
The Tech Side of Project Argo
The Tech Side of Project ArgoThe Tech Side of Project Argo
The Tech Side of Project Argo
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010
 
App in a Browser
App in a BrowserApp in a Browser
App in a Browser
 
Mobile Cross Platform
Mobile Cross PlatformMobile Cross Platform
Mobile Cross Platform
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands
 
Sharing content between hippo and solr
Sharing content between hippo and solrSharing content between hippo and solr
Sharing content between hippo and solr
 
Human APIs - expanding the mobile web or are robots coming to JavaScript?
Human APIs - expanding the mobile web or are robots coming to JavaScript? Human APIs - expanding the mobile web or are robots coming to JavaScript?
Human APIs - expanding the mobile web or are robots coming to JavaScript?
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010
 
5 分でキメル! (慣れれば、あなたもやれる!) たったの 5 分でできるサーバと通信できる iPhone アプリの作成
5 分でキメル!  (慣れれば、あなたもやれる!)  たったの 5 分でできるサーバと通信できる iPhone アプリの作成5 分でキメル!  (慣れれば、あなたもやれる!)  たったの 5 分でできるサーバと通信できる iPhone アプリの作成
5 分でキメル! (慣れれば、あなたもやれる!) たったの 5 分でできるサーバと通信できる iPhone アプリの作成
 
GWT♥HTML5
GWT♥HTML5GWT♥HTML5
GWT♥HTML5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML5 Apps - Cross platform
HTML5 Apps - Cross platformHTML5 Apps - Cross platform
HTML5 Apps - Cross platform
 
Document-Oriented Databases: Couchdb Primer
Document-Oriented Databases: Couchdb PrimerDocument-Oriented Databases: Couchdb Primer
Document-Oriented Databases: Couchdb Primer
 
AlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueilsAlpesJUG - Communautés opensource, stratégies et écueils
AlpesJUG - Communautés opensource, stratégies et écueils
 
MongoDB on Rails (and Ruby)
MongoDB on Rails (and Ruby)MongoDB on Rails (and Ruby)
MongoDB on Rails (and Ruby)
 
Websockets, Ruby y Pusher Webprendedor 2010
Websockets, Ruby y Pusher Webprendedor 2010Websockets, Ruby y Pusher Webprendedor 2010
Websockets, Ruby y Pusher Webprendedor 2010
 

Introduction to jQuery :: CharlotteJS

  • 1. introduction to jQuery Garrett Johnson // CharlotteJS // 8-19-2010 Friday, August 20, 2010
  • 2. Me? Jr. Web Developer at Red Ventures Student I will program in just about anything. Started this joint! (with a lot of help from Nathan and Aaron) Friday, August 20, 2010
  • 3. jQuery Seriously? "jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development." Friday, August 20, 2010
  • 4. jQuery selectors manipulation effects attributes css ajax traversing events utilities Friday, August 20, 2010
  • 5. Lets Get It A quick tour with some stops on the way. Feel free to stop and start discussion. Friday, August 20, 2010
  • 6. document.ready? just an event.* gets triggered once the DOM is parsed/loaded. use as much as you want.* just put your <script></script> prior to </body> or right below the desired element. DOM is ready at this point. portability?* Friday, August 20, 2010
  • 7. document.ready? 1.html Friday, August 20, 2010
  • 8. selectors node type descendants attributes id child expressions* class name multiples more Friday, August 20, 2010
  • 9. selectors 2.html Friday, August 20, 2010
  • 10. selectors cache selectors selector context find() exact on the left, general on the right. avoid pure class or node selectors keep it simple! Friday, August 20, 2010
  • 11. selectors 3.html Friday, August 20, 2010
  • 12. wait... what the $ $ === jQuery $() is a factory.* returns “array like” collection of “jQuery” objects. not just css selectors. raw elements.* html.* Friday, August 20, 2010
  • 13. wait... what the $ 4.html Friday, August 20, 2010
  • 14. manipulation append html detach prepend filter each val *class more Friday, August 20, 2010
  • 15. manipulation 5.html Friday, August 20, 2010
  • 16. traversing parents next attributes children siblings *all prev find more Friday, August 20, 2010
  • 17. traversing 6.html Friday, August 20, 2010
  • 18. traversing / manipulation once you found it. do something. tons more features for traversing and manipulation. the docs are awesome. Friday, August 20, 2010
  • 19. events binding proxy shorthands* custom live delegate namespaces delegation* more Friday, August 20, 2010
  • 20. events find something. bind it. $(‘.foo’).bind(‘click’, fn); $(‘.foo’).click(fn); $(‘.foo’).live(‘click’, fn); $(‘#bar’).delegate(‘.foo’, ‘click’, fn)* Friday, August 20, 2010
  • 21. events 7.html Friday, August 20, 2010
  • 22. events bubbling. delegating. lower memory foot print. performance++ Friday, August 20, 2010
  • 23. events 8.html Friday, August 20, 2010
  • 24. events event.data clean up that repetitive code. binding time.* Friday, August 20, 2010
  • 25. events 9.html Friday, August 20, 2010
  • 26. events custom events clean up that repetitive code.** trigger time. Friday, August 20, 2010
  • 27. events 10.html Friday, August 20, 2010
  • 28. effects hide slide fadeOut show toggle delays animate fadeIn more Friday, August 20, 2010
  • 29. effects nifty.... Friday, August 20, 2010
  • 30. ajax get getJSON ajaxSetup post ajax events* load getScript more Friday, August 20, 2010
  • 31. ajax shorthand methods the core ajax method default configuration events global local Friday, August 20, 2010
  • 32. ajax 12.html Friday, August 20, 2010
  • 33. extending plugins expressions Friday, August 20, 2010
  • 34. extending 13.html Friday, August 20, 2010
  • 35. what else? questions? favorite plugins? problems? Friday, August 20, 2010
  • 36. peace! gtalk: gjj391 aim: gjohnson391 pdf/code will be on github.com/gjohnson Friday, August 20, 2010