SlideShare une entreprise Scribd logo
1  sur  12
Introduction to jQuery James Johnson Founder and President, Inland Empire .NET User’s Group Technical Evangelist, ComponentOne
JavaScript Used to provide interactivity with a web page Enable programmatic access to a web page Dynamic Weakly typed Prototype-based Supports closures and higher order function
JavaScript Not to be confused with Java, it has a similar syntax {} and ; First released as LiveScript in September 1995 Renamed to JavaScript in December 1995 Easy to write functions, then copy and paste all over Quickly one of the most popular languages for web development  But thought of as a kiddy language Advent of Ajax brought JavaScript attention by “professionals”
JavaScript	 Pros Dynamic Easy to develop with Easy to debug Similar syntax to “real” languages Cons Dynamic Easy to develop with Every browser seems to have it’s own JavaScript engine Difficult to have same behaviours across browsers
JavaScript libraries Pre-written JavaScript controls Easier development Many, many libraries Dojo, Echo, Ext, Google Web Toolkit, jQuery, MochiKit, MooTools,  Prototype, qooxdoo, Rico, script.aculo.us, Spry, Yahoo! UI Library
jQuery Released in January 2006 by John Resig BarCamp (an international network of user-generated conferences ) Free, open source, dual-licensed under MIT and GNU Syntax is easier to navigate the DOM Handles events Creates animations Ajax grooviness baked in Used by over 39% of the top 10,000 websites Microsoft bundles with ASP.NET Ajax and ASP.NET MVC Full support from Microsoft
jQuery Syntax	 $(“some element”) or jQuery(“some element”) Can select by ID or className $(“#myElement”) gets the only ID=“myElement”  $(“div.myElement”) gets all divs with class=“myElement” Easy to traverse $(“div.mainul li”) – all <li> within div class=“main” $(“div.main”).find(“li”) – same as above $(“div.main”).find(“li:odd”) – same as above but only ODD elements – zero-based http://api.jquery.com/category/selectors/
jQuery Events Two main methods to attach event $(document).ready(function(){	$(“myElement”).click(function() { doSomething(); });}); Fired when the DOM is completely loaded $(“myElement”).live(“click”, function() { doSomething(); }); Fired when the element is created in the DOM http://api.jquery.com/category/events/
jQuery Chaining Once an element is found, reference is kept Instead of $(“div.myElement”).hide(); $(“div.myElement”).html(“hi”); $(“div.myElement”).addClass(“red”); $(“div.myElement”).fadeIn(“slow”); Chain the actions $(“div.myElement”).hide().html(“hi”).addClass(“red”).fadeIn(“slow”);
jQuery stuff you can do Selectors – find elements in the DOM Attributes – get/set attributes of found elements Traversing – moving up/down elements in the DOM Manipulation – get/set contents of found elements CSS – get/set style attributes of found elements Events – fire on click, hover, load, etc. of found elements Effects – fadeIn, fadeOut, slideIn/Out, hide/show Ajax – full Ajax capabilities Utilities – inArray, isArray, makeArray, etc.
jQuery benefits Fast development Solid, standardized library Gracefully fails – no glaring errors or frozen pages Lots and lots and lots of examples Very easy to grok All the cool kids use it
Demo

Contenu connexe

Tendances

jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
mowd8574
 

Tendances (19)

jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010
 
Contextual jQuery
Contextual jQueryContextual jQuery
Contextual jQuery
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
jQuery Mobile with HTML5
jQuery Mobile with HTML5jQuery Mobile with HTML5
jQuery Mobile with HTML5
 
JQuery
JQueryJQuery
JQuery
 
Jquery
JqueryJquery
Jquery
 
Web Development Introduction to jQuery
Web Development Introduction to jQueryWeb Development Introduction to jQuery
Web Development Introduction to jQuery
 
Introduction to j_query
Introduction to j_queryIntroduction to j_query
Introduction to j_query
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)
 
J query intro_29thsep_alok
J query intro_29thsep_alokJ query intro_29thsep_alok
J query intro_29thsep_alok
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
 
Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)
 
Jquery mobile
Jquery mobileJquery mobile
Jquery mobile
 
State of jQuery and Drupal
State of jQuery and DrupalState of jQuery and Drupal
State of jQuery and Drupal
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Lazy load Everything!
Lazy load Everything!Lazy load Everything!
Lazy load Everything!
 

En vedette

SW Development Methodologies
SW Development MethodologiesSW Development Methodologies
SW Development Methodologies
thiago_tadeu
 
Green Eco Powerpoint
Green Eco PowerpointGreen Eco Powerpoint
Green Eco Powerpoint
cbrady24
 
Thông tin đăng ký Thẻ dùng tin
Thông tin đăng ký Thẻ dùng tinThông tin đăng ký Thẻ dùng tin
Thông tin đăng ký Thẻ dùng tin
Ud Lirc
 
Brian Hunter Recommendation
Brian Hunter RecommendationBrian Hunter Recommendation
Brian Hunter Recommendation
Brian Hunter
 

En vedette (20)

Nz immigration
Nz immigrationNz immigration
Nz immigration
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
A Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETA Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NET
 
SW Development Methodologies
SW Development MethodologiesSW Development Methodologies
SW Development Methodologies
 
Semantics
SemanticsSemantics
Semantics
 
Fisio reproduksi pria
Fisio reproduksi priaFisio reproduksi pria
Fisio reproduksi pria
 
ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4
 
Phomenes
PhomenesPhomenes
Phomenes
 
Green Eco Powerpoint
Green Eco PowerpointGreen Eco Powerpoint
Green Eco Powerpoint
 
Laporan ekspedisi kir
Laporan ekspedisi kirLaporan ekspedisi kir
Laporan ekspedisi kir
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
 
La sql
La sqlLa sql
La sql
 
Semantics
SemanticsSemantics
Semantics
 
Ekskresi
EkskresiEkskresi
Ekskresi
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Java script aula 10 - angularjs
Java script   aula 10 - angularjsJava script   aula 10 - angularjs
Java script aula 10 - angularjs
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
 
Thông tin đăng ký Thẻ dùng tin
Thông tin đăng ký Thẻ dùng tinThông tin đăng ký Thẻ dùng tin
Thông tin đăng ký Thẻ dùng tin
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Brian Hunter Recommendation
Brian Hunter RecommendationBrian Hunter Recommendation
Brian Hunter Recommendation
 

Similaire à Introduction to jQuery

jQuery From the Ground Up
jQuery From the Ground UpjQuery From the Ground Up
jQuery From the Ground Up
Kevin Griffin
 
jQuery Learning
jQuery LearningjQuery Learning
jQuery Learning
Uzair Ali
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
testingphase
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
Mark Roden
 

Similaire à Introduction to jQuery (20)

Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
J Query
J QueryJ Query
J Query
 
jQuery From the Ground Up
jQuery From the Ground UpjQuery From the Ground Up
jQuery From the Ground Up
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
jQuery Learning
jQuery LearningjQuery Learning
jQuery Learning
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
 
Jquery
JqueryJquery
Jquery
 
jQuery
jQueryjQuery
jQuery
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
Web2 - jQuery
Web2 - jQueryWeb2 - jQuery
Web2 - jQuery
 
jQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzjQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda Katz
 
jQuery
jQueryjQuery
jQuery
 
Js Saturday 2013 your jQuery could perform better
Js Saturday 2013 your jQuery could perform betterJs Saturday 2013 your jQuery could perform better
Js Saturday 2013 your jQuery could perform better
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Introduction to jQuery

  • 1. Introduction to jQuery James Johnson Founder and President, Inland Empire .NET User’s Group Technical Evangelist, ComponentOne
  • 2. JavaScript Used to provide interactivity with a web page Enable programmatic access to a web page Dynamic Weakly typed Prototype-based Supports closures and higher order function
  • 3. JavaScript Not to be confused with Java, it has a similar syntax {} and ; First released as LiveScript in September 1995 Renamed to JavaScript in December 1995 Easy to write functions, then copy and paste all over Quickly one of the most popular languages for web development But thought of as a kiddy language Advent of Ajax brought JavaScript attention by “professionals”
  • 4. JavaScript Pros Dynamic Easy to develop with Easy to debug Similar syntax to “real” languages Cons Dynamic Easy to develop with Every browser seems to have it’s own JavaScript engine Difficult to have same behaviours across browsers
  • 5. JavaScript libraries Pre-written JavaScript controls Easier development Many, many libraries Dojo, Echo, Ext, Google Web Toolkit, jQuery, MochiKit, MooTools, Prototype, qooxdoo, Rico, script.aculo.us, Spry, Yahoo! UI Library
  • 6. jQuery Released in January 2006 by John Resig BarCamp (an international network of user-generated conferences ) Free, open source, dual-licensed under MIT and GNU Syntax is easier to navigate the DOM Handles events Creates animations Ajax grooviness baked in Used by over 39% of the top 10,000 websites Microsoft bundles with ASP.NET Ajax and ASP.NET MVC Full support from Microsoft
  • 7. jQuery Syntax $(“some element”) or jQuery(“some element”) Can select by ID or className $(“#myElement”) gets the only ID=“myElement” $(“div.myElement”) gets all divs with class=“myElement” Easy to traverse $(“div.mainul li”) – all <li> within div class=“main” $(“div.main”).find(“li”) – same as above $(“div.main”).find(“li:odd”) – same as above but only ODD elements – zero-based http://api.jquery.com/category/selectors/
  • 8. jQuery Events Two main methods to attach event $(document).ready(function(){ $(“myElement”).click(function() { doSomething(); });}); Fired when the DOM is completely loaded $(“myElement”).live(“click”, function() { doSomething(); }); Fired when the element is created in the DOM http://api.jquery.com/category/events/
  • 9. jQuery Chaining Once an element is found, reference is kept Instead of $(“div.myElement”).hide(); $(“div.myElement”).html(“hi”); $(“div.myElement”).addClass(“red”); $(“div.myElement”).fadeIn(“slow”); Chain the actions $(“div.myElement”).hide().html(“hi”).addClass(“red”).fadeIn(“slow”);
  • 10. jQuery stuff you can do Selectors – find elements in the DOM Attributes – get/set attributes of found elements Traversing – moving up/down elements in the DOM Manipulation – get/set contents of found elements CSS – get/set style attributes of found elements Events – fire on click, hover, load, etc. of found elements Effects – fadeIn, fadeOut, slideIn/Out, hide/show Ajax – full Ajax capabilities Utilities – inArray, isArray, makeArray, etc.
  • 11. jQuery benefits Fast development Solid, standardized library Gracefully fails – no glaring errors or frozen pages Lots and lots and lots of examples Very easy to grok All the cool kids use it
  • 12. Demo