Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
jQuery
Search
Ryan L. Cross
September 19, 2012
Programming
440
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jQuery
Ryan L. Cross
September 19, 2012
More Decks by Ryan L. Cross
See All by Ryan L. Cross
Nest & Hue
slant
0
120
Introduction to Ruby
slant
1
260
jQuery
slant
1
320
HTML and CSS
slant
1
240
Other Decks in Programming
See All in Programming
オーケストレーション記述言語 Katari
yukikurage
0
220
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
350
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
2.5k
Next.js: The final boss of Web Performance
guaca
0
380
Groovy as a human and AI friendly programming language
paulk
0
170
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
120
8年前のNode.jsを動かして分かった、npm installの裏側
keisukeikeda
0
120
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
5k
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
210
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
340
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
14
11k
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
820
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
52k
The Cult of Friendly URLs
andyhume
79
7.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
490
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Done Done
chrislema
187
17k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Crafting Experiences
bethany
1
410
How to Talk to Developers About Accessibility
jct
2
610
Documentation Writing (for coders)
carmenintech
77
5.6k
Six Lessons from altMBA
skipperchong
29
4.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Transcript
Enclave Discussions by Ryan L. Cross Tuesday, September 18, 12
What is jQuery? j•Query noun \jā-ˈkwir-ē\ A fast and concise
JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. Tuesday, September 18, 12
The Players ‣ The jQuery object ‣ jQuery(document) ‣ $(document)
‣ Selectors ‣ $('div') ‣ Methods ‣ $('p').show() ‣ Method chaining ‣ $('p').val('Hello there').show() ‣ Functions ‣ function say(something) { alert(something) } ‣ (function(){ alert("Hello there!") })() Tuesday, September 18, 12
Selectors ‣ Element selector ‣ $('p') ‣ ID and Class
selectors ‣ $('div#things') ‣ $('p.note') ‣ Attribute selectors ‣ $('input[type=text]') ‣ Pseudo selectors ‣ $('input:focus') ‣ $('input:blur') ‣ Pseudo selectors ‣ $(':has(p)') http://api.jquery.com/category/selectors An extremely powerful way to specify which elements you want. <p>first</p> <p>second</p> <div id="things"></div> <p class="note"></p> <input type="text" /> <input /> <div><p></p></div> Tuesday, September 18, 12
Effects ‣ Show and hide ‣ $('#box').hide() ‣ $('#box').show() ‣
Fade ‣ $('#box').fadeOut() ‣ $('#box').fadeIn() ‣ Animate ‣ $('#box').animate( { opacity: 0.5 }, 5000, function(){ alert('It moved!') } ) http://api.jquery.com/category/effects Making things look pretty Tuesday, September 18, 12
Events ‣ Events in general ‣ $('button').click(function(){ alert('Clicked!') }) ‣
$('input').focus(function(){ alert('Please type a thing.') }) ‣ A problem ‣ $('.add-li').click(function(){ $('ul').append('<li class="cats"></li>') }) ‣ $('.cats').click(function(){ alert('Clicked!') }) ‣ bind() and live() ‣ $(...).bind(...) ‣ $(...).live(...) ‣ Introducing on() ‣ $('button').on('click', function(){ alert('Clicked!') }) http://api.jquery.com/category/events Responding to user actions Tuesday, September 18, 12
Hey document, are you ready? ‣ document object ‣ $(document).ready()
‣ $(document).ready(function(){ // do things here }) Tuesday, September 18, 12
AJAX ‣ AJAX requests ‣ $.ajax({ url: 'http://example.com/users.json', data: {
name: 'Ryan' }, type: 'post', complete: function(data, textStatus, jqxhr){ alert('Done!') } }) ‣ GET requests ‣ $.get('http://example.com/users.json') ‣ POST requests ‣ $.post( 'http://example.com/users.json', { name: 'Ryan' }, function(data){ alert('Done!') } ) ‣ load() ‣ $('#things').load('http://example.com/users.json') http://api.jquery.com/category/events How to communicate with an API Tuesday, September 18, 12
Live Demo Guaranteed to fail many times! Tuesday, September 18,
12
Fin Tuesday, September 18, 12
Ryan L. Cross github.com/cylence @slant Coming up next Oct 16,
2012 Backbone.js Nov 20, 2012 Node.js Tuesday, September 18, 12