SlideShare a Scribd company logo
Fundamental of
jQuery




Zhouquan.yezq
Senior Web Developer
Agenda
•   Selector
•   Array/Object
•   Event handing
•   Custom event
•   Deferred/promised
What    find something, then
jQuery   do some action
 does?
Selector
Native DOM Support                         jQuery Support
getElementById                             $(‘#id’)
getElementByTagName                        $(‘div’) element
getElementsByName                          $(‘input*name=“myinput”+’)
                                           $(‘*’)…


div.class1
div .class1
div > .class1
http://www.w3.org/TR/CSS21/selector.html
Array/Object
$.Each
$.Map
$.slice
Event Handing
• Capturing



• Bubbling




http://www.quirksmode.org/js/events_order.h
tml
W3C Model




   element1.addEventListener('click',doSomething2,true)




jQuery ‘s delegate method and Backbone view Event use the bubble phase.
Custom Event
$.trigger
$(‘li’).on(‘mycustomevent’,function(){
 //todo
})
$(‘li’).trigger(‘mycustomevent’);

Our pub/sub method idea come from here
Deferred/Promised
01: challenges with the Async programming
http://blogs.msdn.com/b/ie/archive/2011/09/11/asynchronous-programming-in-javascript-with-promises.aspx


02: jQuery
$.ajax({
      url: 'http://search.twitter.com/search.json',
      dataType: 'jsonp',
      data: { q: '#IE10', rpp: 100 }
      }).success(function (data) {
               /* handle data */
      }).error(function (error) {
               /* handle error */
});


03: How to make promised function

More Related Content

What's hot (20)

PDF
HTML5 and Mobile
doodoofish
 
PDF
jQuery's Secrets
Bastian Feder
 
PPTX
Introduction to j_query
Basavaraj Hampali
 
PDF
So long, jQuery, and thanks for all the fish!
Matt Turnure
 
PDF
How kris-writes-symfony-apps-london
Kris Wallsmith
 
PPTX
Jquery Basics
Umeshwaran V
 
PDF
How Kris Writes Symfony Apps
Kris Wallsmith
 
PDF
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
Darren Mothersele
 
KEY
Web storage
Junji Manno
 
PDF
jQuery Way
Ferry Mulyono
 
PDF
Introducing jQuery
Wildan Maulana
 
PDF
An Introduction to Jquery
Phil Reither
 
PDF
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
Robert Nyman
 
PDF
jQuery Behaviours
Richard Paul
 
PPTX
jQuery Best Practice
chandrashekher786
 
PDF
えっ、なにそれこわい
Kei Shiratsuchi
 
PDF
Matters of State
Kris Wallsmith
 
PDF
International News | World News
cojocarujanosko
 
HTML5 and Mobile
doodoofish
 
jQuery's Secrets
Bastian Feder
 
Introduction to j_query
Basavaraj Hampali
 
So long, jQuery, and thanks for all the fish!
Matt Turnure
 
How kris-writes-symfony-apps-london
Kris Wallsmith
 
Jquery Basics
Umeshwaran V
 
How Kris Writes Symfony Apps
Kris Wallsmith
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
Darren Mothersele
 
Web storage
Junji Manno
 
jQuery Way
Ferry Mulyono
 
Introducing jQuery
Wildan Maulana
 
An Introduction to Jquery
Phil Reither
 
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
Robert Nyman
 
jQuery Behaviours
Richard Paul
 
jQuery Best Practice
chandrashekher786
 
えっ、なにそれこわい
Kei Shiratsuchi
 
Matters of State
Kris Wallsmith
 
International News | World News
cojocarujanosko
 

Viewers also liked (9)

PDF
Oculus Collection 2010
kjincan
 
PPTX
Web performance
Major Ye
 
PPTX
Suzonnecrockett Texas S Ta R Chart
suzonnecrockett
 
PPT
Crowsnest Fire
meryl77
 
PPS
Beaux Jardins
Andy Feuerstein
 
PPTX
Easy charting with
Major Ye
 
PPTX
Suzonnecrockett Texas S Ta R Chart
suzonnecrockett
 
PDF
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Oculus Collection 2010
kjincan
 
Web performance
Major Ye
 
Suzonnecrockett Texas S Ta R Chart
suzonnecrockett
 
Crowsnest Fire
meryl77
 
Beaux Jardins
Andy Feuerstein
 
Easy charting with
Major Ye
 
Suzonnecrockett Texas S Ta R Chart
suzonnecrockett
 
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Ad

Similar to Jquery introduce (20)

PDF
jQuery
Ivano Malavolta
 
PPT
JavaScript JQUERY AJAX
Makarand Bhatambarekar
 
ODP
Event handling using jQuery
Iban Martinez
 
PDF
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
 
PDF
Introduction to jQuery
Zeeshan Khan
 
PPTX
Unit-III_JQuery.pptx engineering subject for third year students
MARasheed3
 
PDF
Javascript libraries
Dumindu Pahalawatta
 
PDF
J query fundamentals
Attaporn Ninsuwan
 
PPTX
Javascript And J Query
itsarsalan
 
PDF
jQuery secrets
Bastian Feder
 
PDF
Rails Presentation - Technology Books, Tech Conferences
tutorialsruby
 
PDF
JQuery-Tutorial" />
tutorialsruby
 
PDF
jQuery%20on%20Rails%20Presentation
guestcf600a
 
PDF
jQuery%20on%20Rails%20Presentation
guestcf600a
 
PPTX
jQuery
Jon Erickson
 
PPTX
Introduction to JQuery
Muhammad Afzal Qureshi
 
PPTX
Starting with jQuery
Anil Kumar
 
PDF
Javascript essential-pattern
偉格 高
 
PPT
J query module1
Srivatsan Krishnamachari
 
JavaScript JQUERY AJAX
Makarand Bhatambarekar
 
Event handling using jQuery
Iban Martinez
 
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
 
Introduction to jQuery
Zeeshan Khan
 
Unit-III_JQuery.pptx engineering subject for third year students
MARasheed3
 
Javascript libraries
Dumindu Pahalawatta
 
J query fundamentals
Attaporn Ninsuwan
 
Javascript And J Query
itsarsalan
 
jQuery secrets
Bastian Feder
 
Rails Presentation - Technology Books, Tech Conferences
tutorialsruby
 
JQuery-Tutorial" />
tutorialsruby
 
jQuery%20on%20Rails%20Presentation
guestcf600a
 
jQuery%20on%20Rails%20Presentation
guestcf600a
 
jQuery
Jon Erickson
 
Introduction to JQuery
Muhammad Afzal Qureshi
 
Starting with jQuery
Anil Kumar
 
Javascript essential-pattern
偉格 高
 
J query module1
Srivatsan Krishnamachari
 
Ad

Jquery introduce