SlideShare a Scribd company logo
Eric.Steinborn@dcjs.state.ny.us
Poll
Just Thought you should know
Eric Steinborn IT2P @ NYS Division of Criminal Justice Services since 2006 15+ years experience with web technologies Work in a group of 3 Maintain our intranet (DCJSnet) Help with internet and extranet sites A few things I'm awesome at are: CSS, JavaScript, Interactivity, Prog Enhancement, UX, SEO, Accessibility I do what I love -> I love my job!
What is jQuery? ,[object Object]
Animations
DOM manipulation
AJAX
Extensibility through plugins
jQuery was created by John Resig and released 01/06
Most current release is 1.4.2 (2/19/10)A Little Bit About jQuery
Why should you use it? ,[object Object]
Its tiny 71KB (24KB, minified and Gzipped)
Documentedapi.jquery.com & Supported forum.jquery.com
Cross browser compatibility: IE 6+,  FF 2+
It is the most used JavaScript library on the web today
39% of all sites that use JavaScript use jQuery.
trends.builtwith.com/javascript/JQuery <- See, I'm not a liar..A Little Bit About jQuery
I <3 The jQuery Community
PWNS All Other Frameworks
Who Uses jQuery? docs.jquery.com/Sites_Using_jQuery
Who Uses jQuery In NY?
What is the DOM? Document Object Model (DOM): noun Blah blahblah long definition that makes little sense….
What Is The DOM? Long story short, the DOM is your html document code. From the  <!DOCTYPE> to the </html> The DOM is loaded top to bottom, so include your scripts at the bottom of the page for best performance. The DOM is "ready" when everything on the page has loaded.  ,[object Object]
JavaScripts
Images,[object Object]
And What If I Don't Wanna, Huh? 1 of 3 things will happen: Code doesn't work, throws an error (90%) Code works… this page load, next page load see #1. (~9%) Code opens a worm hole that transports your page back to 1990 revolutionizing the Web as we know it. While seemingly great, it also creates a paradox and destroys the universe. * (<1%) *(has yet to be fully verified)
We get it Eric, you're a geek…Get to the jQuery already! Your about ta get a wedgie NERD!* *spelling intentional
Loading jQuery In order to use jQuery you need to load it. You can include it locally on your own server: <script src="/js/jquery.js"> Or use one of the CDN's made available: ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js CDN's are Gzipped and minified
Load Scripts At The Bottom Problem: When scripts are downloading they block everything else in almost all browsers! Solution: Best practice: Load your scripts at the bottom of your page so they don't interrupt page content downloads.
And BOOM! Goes The Dynamite. jsbin.com/ecayo3/18#slide19 Html: <p>Hello World! I'm Eric</p> Script: $(function(){  $("p").addClass("isCool"); //keep telling yourself that.. }); Resulting html: <p class="isCool">Hello World! I'm Eric</p>
Break It Down Now! $ ("p") .addClass("isCool"); Grabs a DOM element using a CSS selector. Built in method that adds a class to the jQuery Collection $(function(){// = $(document).ready(function(){ Initiates the jQuery function Selector is in quotes. Class is in quotes. Creates a jQuery “Collection” $  =  jQuery ends with a semicolon. <p> });
All Your Basic Selectors Are Belong To Us Uses the same syntax you use to style elements in CSS! api.jquery.com/category/selectors/
Get Classy <p> jQuery: $("p").addClass("sophisticated"); Before: <p> After: <p class="sophisticated"> jsbin.com/ecayo3/18#slide22
This <p> Has No Class At All! jQuery: $("p").removeClass("sophisticated"); Before: <p class="sophisticated"> After: <p class=""> jsbin.com/ecayo3/18#slide22
<div> Hide and Seek jQuery: $("div").show(); Before: <div style="display:none;"> After: <div style="display:block;"> jsbin.com/ecayo3/18#slide24
I’m Not Lame, Am I? jQuery: $("#eric").text("Is Cool"); Before: <p id="eric">Is Lame</p> After: <p id="eric">Is Cool</p> jsbin.com/ecayo3/18#slide25
You Can Chain Most Methods Together $("p") 	.addClass("sophisticated") 	.text("Hello World!") 	.show(); jsbin.com/ecayo3/18#slide26
Click Events Are Awesome! $("#eric").click(function(){ $(this).text("Is Cool"); // this = #eric alert("Take that High School!"); }); $("#eric").click(function(event){ $(this).text("Is Cool"); // this = #eric 		alert("Take that High School!"); event.preventDefault(); //Prevents default action }); jsbin.com/ecayo3/18#slide27
Some of Basic Methods api.jquery.com/
Getters and Setters
Dual Purpose Methods
Use jQuery To Get <p>Eric</p>
Use jQuery To Set <p>Eric</p>
Questions?
Plugins
Viva Variety! “If you want to create an animation, effect or UI component, chances are pretty good that someone has done your work for you already.” -Eric Steinborn 2010 plugins.jquery.com

More Related Content

What's hot

Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
Yehuda Katz
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuff
jeresig
 
SproutCore is Awesome - HTML5 Summer DevFest
SproutCore is Awesome - HTML5 Summer DevFestSproutCore is Awesome - HTML5 Summer DevFest
SproutCore is Awesome - HTML5 Summer DevFest
tomdale
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
JQuery in Seaside
JQuery in SeasideJQuery in Seaside
JQuery in Seaside
ESUG
 
Huge web apps web expo 2013
Huge web apps web expo 2013Huge web apps web expo 2013
Huge web apps web expo 2013
Daniel Steigerwald
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
Dave Artz
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy AppsPeter Drinnan
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynotedmethvin
 
Fluentlenium
FluentleniumFluentlenium
Fluentlenium
MathildeLemee
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
jeresig
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Pablo Godel
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
jeresig
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
Martin Hochel
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayCodecademy Ren
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
jeresig
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
Brian Moschel
 

What's hot (20)

Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuff
 
SproutCore is Awesome - HTML5 Summer DevFest
SproutCore is Awesome - HTML5 Summer DevFestSproutCore is Awesome - HTML5 Summer DevFest
SproutCore is Awesome - HTML5 Summer DevFest
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
JQuery in Seaside
JQuery in SeasideJQuery in Seaside
JQuery in Seaside
 
Huge web apps web expo 2013
Huge web apps web expo 2013Huge web apps web expo 2013
Huge web apps web expo 2013
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy Apps
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
Inside jQuery (2011)
Inside jQuery (2011)Inside jQuery (2011)
Inside jQuery (2011)
 
Fluentlenium
FluentleniumFluentlenium
Fluentlenium
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ay
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
 
J query intro_29thsep_alok
J query intro_29thsep_alokJ query intro_29thsep_alok
J query intro_29thsep_alok
 

Viewers also liked

Evaluation activity 2 final
Evaluation activity 2 finalEvaluation activity 2 final
Evaluation activity 2 finalpopo1996
 
חגי גולדמן מיה מחשבים
חגי גולדמן מיה מחשביםחגי גולדמן מיה מחשבים
חגי גולדמן מיה מחשביםAnochi.com.
 
กลไกสังคม
กลไกสังคมกลไกสังคม
กลไกสังคม
Dowroong Wittaya School
 
Right2the Land Of Israel
Right2the Land Of  IsraelRight2the Land Of  Israel
Right2the Land Of IsraelAnochi.com.
 
Dissertations - Writing with Power, OR "Academic" Is No One's First Language
Dissertations - Writing with Power, OR "Academic" Is No One's First LanguageDissertations - Writing with Power, OR "Academic" Is No One's First Language
Dissertations - Writing with Power, OR "Academic" Is No One's First LanguageIlene Dawn Alexander
 
08 13 209b ההוצאה הלאומית לחינוך בשנת 2010
08 13 209b ההוצאה הלאומית לחינוך בשנת 201008 13 209b ההוצאה הלאומית לחינוך בשנת 2010
08 13 209b ההוצאה הלאומית לחינוך בשנת 2010
Anochi.com.
 
Catalogogadget
CatalogogadgetCatalogogadget
Catalogogadget
rtodto84
 
כלכלה מסביב לעולם - שבדיה
כלכלה מסביב לעולם - שבדיהכלכלה מסביב לעולם - שבדיה
כלכלה מסביב לעולם - שבדיה
Anochi.com.
 
06 14 284b השכלה גבוהה בישראל
06 14 284b השכלה גבוהה בישראל 06 14 284b השכלה גבוהה בישראל
06 14 284b השכלה גבוהה בישראל Anochi.com.
 
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking EngagementACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
J Grant Mizell
 
Documenting Teaching Effectiveness
Documenting Teaching EffectivenessDocumenting Teaching Effectiveness
Documenting Teaching EffectivenessIlene Dawn Alexander
 
Resumo - gênero textual
Resumo - gênero textualResumo - gênero textual
Resumo - gênero textual
Ana Lúcia Moura Neves
 
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתוצו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
Anochi.com.
 
Ayn rand collectivized rights arabic
Ayn rand collectivized rights arabicAyn rand collectivized rights arabic
Ayn rand collectivized rights arabicAnochi.com.
 
תמיכות למוסדות מוסיקה
תמיכות למוסדות מוסיקהתמיכות למוסדות מוסיקה
תמיכות למוסדות מוסיקהAnochi.com.
 
Desalination in Israel
Desalination in IsraelDesalination in Israel
Desalination in IsraelAnochi.com.
 
Desalination in-israel
Desalination in-israelDesalination in-israel
Desalination in-israelAnochi.com.
 
מודל הגיוס לצה'ל - סיכום דיוני שולחן עגול, יוני 2014
מודל הגיוס לצה'ל  -  סיכום דיוני שולחן עגול, יוני 2014מודל הגיוס לצה'ל  -  סיכום דיוני שולחן עגול, יוני 2014
מודל הגיוס לצה'ל - סיכום דיוני שולחן עגול, יוני 2014
Anochi.com.
 

Viewers also liked (20)

Evaluation activity 2 final
Evaluation activity 2 finalEvaluation activity 2 final
Evaluation activity 2 final
 
חגי גולדמן מיה מחשבים
חגי גולדמן מיה מחשביםחגי גולדמן מיה מחשבים
חגי גולדמן מיה מחשבים
 
กลไกสังคม
กลไกสังคมกลไกสังคม
กลไกสังคม
 
Right2the Land Of Israel
Right2the Land Of  IsraelRight2the Land Of  Israel
Right2the Land Of Israel
 
Fire protection
Fire protectionFire protection
Fire protection
 
Dissertations - Writing with Power, OR "Academic" Is No One's First Language
Dissertations - Writing with Power, OR "Academic" Is No One's First LanguageDissertations - Writing with Power, OR "Academic" Is No One's First Language
Dissertations - Writing with Power, OR "Academic" Is No One's First Language
 
08 13 209b ההוצאה הלאומית לחינוך בשנת 2010
08 13 209b ההוצאה הלאומית לחינוך בשנת 201008 13 209b ההוצאה הלאומית לחינוך בשנת 2010
08 13 209b ההוצאה הלאומית לחינוך בשנת 2010
 
Timothy CV
Timothy CVTimothy CV
Timothy CV
 
Catalogogadget
CatalogogadgetCatalogogadget
Catalogogadget
 
כלכלה מסביב לעולם - שבדיה
כלכלה מסביב לעולם - שבדיהכלכלה מסביב לעולם - שבדיה
כלכלה מסביב לעולם - שבדיה
 
06 14 284b השכלה גבוהה בישראל
06 14 284b השכלה גבוהה בישראל 06 14 284b השכלה גבוהה בישראל
06 14 284b השכלה גבוהה בישראל
 
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking EngagementACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
ACT Chesapeake Chapter TDM Workshop 12/10: Sparking Engagement
 
Documenting Teaching Effectiveness
Documenting Teaching EffectivenessDocumenting Teaching Effectiveness
Documenting Teaching Effectiveness
 
Resumo - gênero textual
Resumo - gênero textualResumo - gênero textual
Resumo - gênero textual
 
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתוצו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
צו הפיקוח על מצרכים ושירותים ייצור דבש ומכירתו
 
Ayn rand collectivized rights arabic
Ayn rand collectivized rights arabicAyn rand collectivized rights arabic
Ayn rand collectivized rights arabic
 
תמיכות למוסדות מוסיקה
תמיכות למוסדות מוסיקהתמיכות למוסדות מוסיקה
תמיכות למוסדות מוסיקה
 
Desalination in Israel
Desalination in IsraelDesalination in Israel
Desalination in Israel
 
Desalination in-israel
Desalination in-israelDesalination in-israel
Desalination in-israel
 
מודל הגיוס לצה'ל - סיכום דיוני שולחן עגול, יוני 2014
מודל הגיוס לצה'ל  -  סיכום דיוני שולחן עגול, יוני 2014מודל הגיוס לצה'ל  -  סיכום דיוני שולחן עגול, יוני 2014
מודל הגיוס לצה'ל - סיכום דיוני שולחן עגול, יוני 2014
 

Similar to Intro to jQuery

jQuery and_drupal
jQuery and_drupaljQuery and_drupal
jQuery and_drupal
BlackCatWeb
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
Refresh Events
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
Eugene Andruszczenko
 
J Query - Your First Steps
J Query - Your First StepsJ Query - Your First Steps
J Query - Your First Steps
Bronson Quick
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
MobME Technical
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
Sven Haiges
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
alexsaves
 
jQuery
jQueryjQuery
jQuery
Vishwa Mohan
 
jQuery Intro
jQuery IntrojQuery Intro
jQuery Intro
Jason Noble
 
Javascript
JavascriptJavascript
Javascripttimsplin
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint Dev
Zeddy Iskandar
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQueryShea Frederick
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Sergey Ilinsky
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
Eric Steele
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
Brendan Sera-Shriar
 

Similar to Intro to jQuery (20)

jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
jQuery and_drupal
jQuery and_drupaljQuery and_drupal
jQuery and_drupal
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
 
J Query - Your First Steps
J Query - Your First StepsJ Query - Your First Steps
J Query - Your First Steps
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
jQuery
jQueryjQuery
jQuery
 
jQuery Intro
jQuery IntrojQuery Intro
jQuery Intro
 
Javascript
JavascriptJavascript
Javascript
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint Dev
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
J query
J queryJ query
J query
 
jQuery
jQueryjQuery
jQuery
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
 
J Query
J QueryJ Query
J Query
 

Recently uploaded

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Intro to jQuery

  • 3. Just Thought you should know
  • 4. Eric Steinborn IT2P @ NYS Division of Criminal Justice Services since 2006 15+ years experience with web technologies Work in a group of 3 Maintain our intranet (DCJSnet) Help with internet and extranet sites A few things I'm awesome at are: CSS, JavaScript, Interactivity, Prog Enhancement, UX, SEO, Accessibility I do what I love -> I love my job!
  • 5.
  • 10. jQuery was created by John Resig and released 01/06
  • 11. Most current release is 1.4.2 (2/19/10)A Little Bit About jQuery
  • 12.
  • 13. Its tiny 71KB (24KB, minified and Gzipped)
  • 16. It is the most used JavaScript library on the web today
  • 17. 39% of all sites that use JavaScript use jQuery.
  • 18. trends.builtwith.com/javascript/JQuery <- See, I'm not a liar..A Little Bit About jQuery
  • 19. I <3 The jQuery Community
  • 20.
  • 21. PWNS All Other Frameworks
  • 22. Who Uses jQuery? docs.jquery.com/Sites_Using_jQuery
  • 23. Who Uses jQuery In NY?
  • 24. What is the DOM? Document Object Model (DOM): noun Blah blahblah long definition that makes little sense….
  • 25.
  • 27.
  • 28. And What If I Don't Wanna, Huh? 1 of 3 things will happen: Code doesn't work, throws an error (90%) Code works… this page load, next page load see #1. (~9%) Code opens a worm hole that transports your page back to 1990 revolutionizing the Web as we know it. While seemingly great, it also creates a paradox and destroys the universe. * (<1%) *(has yet to be fully verified)
  • 29. We get it Eric, you're a geek…Get to the jQuery already! Your about ta get a wedgie NERD!* *spelling intentional
  • 30. Loading jQuery In order to use jQuery you need to load it. You can include it locally on your own server: <script src="/js/jquery.js"> Or use one of the CDN's made available: ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js CDN's are Gzipped and minified
  • 31. Load Scripts At The Bottom Problem: When scripts are downloading they block everything else in almost all browsers! Solution: Best practice: Load your scripts at the bottom of your page so they don't interrupt page content downloads.
  • 32. And BOOM! Goes The Dynamite. jsbin.com/ecayo3/18#slide19 Html: <p>Hello World! I'm Eric</p> Script: $(function(){ $("p").addClass("isCool"); //keep telling yourself that.. }); Resulting html: <p class="isCool">Hello World! I'm Eric</p>
  • 33. Break It Down Now! $ ("p") .addClass("isCool"); Grabs a DOM element using a CSS selector. Built in method that adds a class to the jQuery Collection $(function(){// = $(document).ready(function(){ Initiates the jQuery function Selector is in quotes. Class is in quotes. Creates a jQuery “Collection” $ = jQuery ends with a semicolon. <p> });
  • 34. All Your Basic Selectors Are Belong To Us Uses the same syntax you use to style elements in CSS! api.jquery.com/category/selectors/
  • 35. Get Classy <p> jQuery: $("p").addClass("sophisticated"); Before: <p> After: <p class="sophisticated"> jsbin.com/ecayo3/18#slide22
  • 36. This <p> Has No Class At All! jQuery: $("p").removeClass("sophisticated"); Before: <p class="sophisticated"> After: <p class=""> jsbin.com/ecayo3/18#slide22
  • 37. <div> Hide and Seek jQuery: $("div").show(); Before: <div style="display:none;"> After: <div style="display:block;"> jsbin.com/ecayo3/18#slide24
  • 38. I’m Not Lame, Am I? jQuery: $("#eric").text("Is Cool"); Before: <p id="eric">Is Lame</p> After: <p id="eric">Is Cool</p> jsbin.com/ecayo3/18#slide25
  • 39. You Can Chain Most Methods Together $("p") .addClass("sophisticated") .text("Hello World!") .show(); jsbin.com/ecayo3/18#slide26
  • 40. Click Events Are Awesome! $("#eric").click(function(){ $(this).text("Is Cool"); // this = #eric alert("Take that High School!"); }); $("#eric").click(function(event){ $(this).text("Is Cool"); // this = #eric alert("Take that High School!"); event.preventDefault(); //Prevents default action }); jsbin.com/ecayo3/18#slide27
  • 41. Some of Basic Methods api.jquery.com/
  • 44. Use jQuery To Get <p>Eric</p>
  • 45. Use jQuery To Set <p>Eric</p>
  • 48. Viva Variety! “If you want to create an animation, effect or UI component, chances are pretty good that someone has done your work for you already.” -Eric Steinborn 2010 plugins.jquery.com
  • 49. I Will Be Covering These Plugins
  • 50. That's Just Typical.. Download the plugin from its site. Depending on the plugin you can have 1 or more files to install. Copy the plugin, and any of its dependencies to your server. If needed call css <link href="plugincss.css" /> Call jQuery <script src="jQuery.js"> Call the plugin <script src"jQuery.pluginname.js"> Initialize plugin $("#mypluginContainer").pluginInit();
  • 51. Go-Go-Get ColorBox! Go to colorpowered.com/colorbox/ This is what you'll get
  • 52. Go-Go-Install ColorBox! Extract min.js to my "/js/plugins/" folder I like example 2 so I'll extract These to my /css/ folder
  • 53. Go-Go-Prep ColorBox! In the <head> type: <link rel="stylesheet" href="css/colorbox.css" media="screen" /> In the <body> type: <a href="unicorn.jpg" rel="colorbox"><imgsrc="unicorn-t.jpg" /></a> <a href="rainbows.jpg" rel="colorbox"><imgsrc="rainbows-t.jpg" /></a> <a href="sparkles.jpg" rel="colorbox"><imgsrc="sparkles-t.jpg" /></a> Before the ending </body> type: <script type="text/javascipt" src="js/jquery.js"></script> <script type="text/javascipt" src="js/jquery.colorbox-min.js"></script> <script type="text/javascipt"></script>
  • 54. Go-Go-Gadget ColorBox! Inside the empty <script> tag I just entered I'll init ColorBox <script> $(function(){ $("a[rel='colorbox']").colorbox(); }); </script> Now anytime I click on a thumbnail, I’ll see a ColorBox with my image in it.
  • 55. Go-Go-Cut It Out Already! jsbin.com/ecayo3/18#slide41 Set custom options for ColorBox like this: $("a[rel='colorbox']").colorbox({ slideshow: true, // shows all your images in sequence slideshowSpeed: 5000, // set the speed of the slideshow in MS transition: "fade",// set the transition between images speed: 1000// set the speed of the transition in MS }); Download ColorBox @ colorpowered.com/colorbox/
  • 56. tablesorter Head: <link href="css/tablesorter.css" /> HTML: <table id="ericsDreams"><!--full table code --></table> Foot: <script src="js/jquery.tablesorter.min.js"></script> <script> $(function(){ $("#ericsDreams").tablesorter(); }); </script>
  • 57. tablesorter Options http://jsbin.com/ecayo3/18#slide43 Set custom options for tablesorter like this: $("#ericsDreams").tablesorter({ widgets: ['zebra']// Zebra stripes alternating rows }); Download tablesorter @ tablesorter.com/docs/
  • 58. ListNav Head: <link href="css/listnav.css" /> HTML: <div id="ericsDreams-nav"></div> <!--needed for nav list--> <ul id="ericsDreams"><!--lots of li's --></ul> Foot: <script src="js/jquery.listnav.min.2.1.js"></script> <script> $(function(){ $("#ericsDreams").listnav(); }); </script>
  • 59. ListNav Options jsbin.com/ecayo3/18#slide45 Set custom options for ListNav like this: $("#ericsDreams").listnav({ showCounts: false, // Don’t show counts above letters noMatchText: "Fail!", // Custom text for invalid selections cookieName: "Dreams", // Selection saved in Cookie includeOther: true// Include an Other option [~!@#] }); // include cookie plugin for cookieName to function Download ListNav @ ihwy.com/Labs/jquery-listnav-plugin.aspx
  • 60. Great References John Resig's introduction slides jQuery 1.4 Cheat Sheet jQuery API jQuery Forums YAYquery Podcast (explicit) DEMOS: jsbin.com/ecayo3/18 eric.steinborn@dcjs.state.ny.us

Editor's Notes

  1. Jquery is totally awesome.I hate how expensive trainings are. So I wanted to give you all training here today that’s priceless.I really like to learn things at meetings
  2. Who uses javascript on their sitesWho uses JavaScript everydaywho uses frameworks (mootools, Dojo, prototype etc)Who uses jQuery
  3. Me
  4. Open Source JavaScript framework.Jquery was created by John Resig in 2006 and since then has exploded into popularity in the web community.
  5. It uses CSS rules to grab DOM elements that&apos;s why its so easy to use, because we all know how to address com elements with css already.Its really small, it loads really fast in most browsers.The community is great. I had a question once about how to do something for the new homepage. I asked the question before i left work and had a response by my ride home.And its compatible with most major browsers. If you make something that works in FF itll work in IE6 guaranteed.
  6. I created this awesome idea to display missing children information on our home page when there was a missing child alert.I just couldn’t figure out how to parse the data I was getting from the page with the kid info on it.So I asked the forums. and
  7. Adam J Sontag from the yayQuery podcast answered my question in 13 minutes.13 minutes.yayQuery podcast has an explicit tag for sparse foul language, nothing terrible. Just if you don’t want your kids hearing the f or s words then use headphones.
  8. Swf object is for putting flash on a page, the closest actual pure JavaScript framework is prototype.And don’t forget that jQueryUI, a part of jQuery is included in this list, above even mootools.
  9. You can see this list on their website.Microsoft just announced that they are going to be dedicating coder time and resources to improving jQuery core, and its plugins. This is HUGE.Mention anti microsoft sentiment, and the fact that even microsoft wants IE6 to die.
  10. This is just a couple of agencies across NY that use jQuery
  11. So I mentioned the DOM before, what exactly is the DOM?
  12. The Document Object Model.The DOM is everything you write in your html documents, images, css, all your tags, everything.The DOM is a mess. There are a million different ways to accomplish things within it and many different doctypes and uppercase and lowercase are allowed attributes that sometimes need quotes, and othertimes don’t. jQuery is coded around all those inconsistencies.jQuerycan modifiythe DOM, but it cant do so untill the DOM is ready.
  13. So we wrap all our jQuery code inside some code. Its called the document ready function, and it is only run after all your page has loaded.Shorthand is$(function(){});
  14. #1 is closer to 99%
  15. Loading from the CDN’s is usually the fastest way, because if you are downloading from one place, you can be downloading from another place at the same time.We usually load it on our servers.
  16. Load at the bottom f the page because when the browser is downloading javascripts it blocks everything elseSo lets light the fuse now…
  17. So lets see what we’re up against.We begin with a plain P tag and end with a p tag with a class of isCoolLets break it down on the next pageDEMO
  18. We check for the DOM to be ready by the $(function() wrapperWe use the $ to initialize a jquery functionThen we surround a CSS selector with parenthesis and quotes (all P’s will be selected)Then I initiate a jquery method called addClass and tell it what class to add. It&apos;s a good thing to note that I don&apos;t add a . Before isCool when adding removing classes. Most methods are alike in how they are called, be careful to check to api to see how to use each method.I end with a semicolon just like most lines of javascript codeAnd then close the document ready wrapperDouble quotes can be swapped with single quotes. Same rules apply as normal html or javascript, if you use one you have to end one before switching to the other.
  19. Here you can see some of the basic css selectors supported by jquerySimple things that you&apos;ve seen a lot before. Div p classes etcIn order to not select everything, make sure to be specific with your CSS selector
  20. I want to make this p tag classy,So I’m going to use the addClass method on it and add the sophisticated class to it you see the before and after htmlNote the lack of . Before the class name, that’s only needed for selection
  21. I remove classes with a different method, but the way in which I do it stays the same.If there were other classes on the p tag they would stay intactDEMO
  22. You can show a div by running the show method.There is a hide method as well.DEMO
  23. Text will change the inner text of a DOM elementDEMO.
  24. Methods can be separated across multiple lines. Or kept on the same lineThis is a best practice for code readabilityMake sure you end your chain with a semicolon;DEMO
  25. Click events are a bit different.In order to have code run when you click you need to declare a function to encapsulate the code you want to runWe create an anonymous function that calls this element (#eric)And it changes the text to Is Cool and throw a javascript alertIf we wanted to prevent the default action, say href=“index.html”Then we call event inside the parenthesis after the function and call event.preventDefault() to prevent the default action of the button
  26. Plenty of examples of basic methods within jQuery.
  27. Getters and setters. These are jquery methods that can give you a value or set a value.You can set a variable to any of these gettersText can get a value or set a value
  28. To get a value you call a method with empty parens. Some functions are different, please check api ex css uses a different syntaxNormally youd set a variable equal to a value of a jquery method getter.Both of these functions do the same
  29. Set a value by including the new value in quotes is how u set it to a literal valueOr reference a variable by not using quotes.Both do the same thing
  30. Questions so far about 15 minutes
  31. Lets get into the meat of jQuery for beginners
  32. Trust me on this
  33. Left out qTip due to timing constraints
  34. This is your typical plugin installation
  35. Colorbox = jsContent = demosExamples = themesInclused the illustrator file for creating your own custom themeREAD THE README
  36. First img is of the /colorbox/Second is the /example3/Colorbox references images in the folder that’s in direct relation to the placement of the css file.
  37. HeadBodyScript – empty, next page
  38. A rel= is an advanced CSS3 selector.
  39. Here are some of the options that can be set for colorbox. Check the full list on their websiteDEMO
  40. DEMO
  41. DEMO
  42. All demos are on JS Bin. It’s a javascript sandbox that allows you to edit my code examples directly.