Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
jQuery
Search
Ryan L. Cross
September 19, 2012
Programming
430
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
110
Introduction to Ruby
slant
1
250
jQuery
slant
1
310
HTML and CSS
slant
1
240
Other Decks in Programming
See All in Programming
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
220
Foundation Models frameworkで画像分析
ryodeveloper
1
610
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
270
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
130
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
プロポーザルを書いてもらう
pvcresin
0
400
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
110
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
750
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.6k
今さら聞けない .NET CLI
htkym
0
190
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
630
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
560
Documentation Writing (for coders)
carmenintech
77
5.4k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
350
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Ethics towards AI in product and experience design
skipperchong
2
340
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
The agentic SEO stack - context over prompts
schlessera
0
860
Crafting Experiences
bethany
1
250
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
270
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.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