SlideShare uma empresa Scribd logo
1 de 20
jQuery Jon Erickson @jonerickson http://jonerickson.me/ http://jonerickson.me/jquery/
What is jQuery? JavaScript framework that makes your life easier Selectors & Chaining DOM Traversing DOM Manipulation Event Handling Animations/Effects AJAX Built-in Utilities Extensible Tons of plug-ins built by the community for our use
Why jQuery? I’m not an expert at JavaScript The people who created jQuery are! Do not need to worry about cross-browser issues (all abstracted) Light Weight (19 kb compressed) DRY – Simple plug-in model allows for code reuse Animations/Effects are simple Community support is growing rapidly Microsoft adoption (included in MVC template) Tutorials, plug-ins, etc. Client-side scripting is fun with jQuery and breathes some new life into your applications Focus more on the code that solves your problem Amazon, BBC, Dell, Google, IBM, NBC, Netflix, Twitter
Sample jQuery Our DOM Include jQuery The ‘ready event’ – Binds a function to be executed whenever the DOM is ready Select the ‘toggleContent’ DOM element and bind a click event handler to it. Select the ‘content’ DOM element and set the text to ‘Hello World!’ Prevent the default behavior of the anchor tag by returning false
Dollar Function $(); JavaScript identifiers can start with $ The jQuery framework automatically assigns ‘$’ to the ‘jQuery’ function $ === jQuerytrue $(selector) is same as jQuery(selector) Can use utility function to unassign $ $.noConflict(); $ === jQuery;	false Can reassign jQuery to another variable $j = $.noConflict();	 $j === jQuery;	true $j === $;		false $ === jQuery;	false
Document Ready Event $(document).ready(fn); The bound function will be called the instant the DOM is ready to be read and manipulated. As many as you want on the page. Executed in the order they were added. There is a shortcut: $(fn);
Selectors CSS3 Selectors
Filters $(‘div:empty’), $(‘:empty’), $(‘div:not(:empty)’) Custom Filter Used
Chaining Most jQuery methods return another jQuery object (usually the same collection), which means you can chain method calls together with a fluent like syntax Some methods that stop a chain, these methods return a value from the jQuery object 	.css(name), .text(), .html(), .val(), .height(), .width(), .is(‘:visible’) Some methods will return a different jQuery collection, you can revert to the previous collection by calling .end();
Attributes & Classes Getters & Setters for attr, html, text, val Getter (returns String – breaks chain) var text = $(‘#myDiv’).text(); Setter (returns jQuery) $(‘#myDiv’).text(‘Hello World!’); text() escapes html() val() used with inputs attr() can take JSON Add, Remove for Attributes & Classes .removeAttr(‘someAttr’); .addClass(‘someClass’); .removeClass(‘someClass’); .toggleClass(‘someClass’);
Traversing Family parent, parents, siblings, children Proximity closest, next, prev, nextAll, prevAll Searching find
Events .bind(type, data, fn) ,[object Object],.one(type, data, fn) ,[object Object],.trigger(event, data) ,[object Object],.unbind(type, fn) ,[object Object],.live(type, fn) ,[object Object],.die(type, fn) ,[object Object],.hover(fnOver, fnOut) ,[object Object],.toggle(fn1, fn2, fn3, fnN, …) ,[object Object],[object Object]
Manipulation Inserting Inside append, prepend appendTo, prependTo Inserting Outside after, before insertAfter, insertBefore Inserting Around wrapInner wrap wrapAll Replacing replaceWith, replaceAll Removing empty, remove Copying clone
Effects Basics show, hide, toggle Sliding slideUp, slideDown, slideToggle Fading fadeIn, fadeOut, fadeTo (opacity 0-1) Custom animate, stop
Plug-ins Extremely Simple – Promotes code reuse and DRY principle $.fn.MyPlugin = function(params) {}; Return a jQuery object to prevent from “breaking the chain” Unless you are returning a specific value Best Practice is to wrap the plug-in declaration within an anonymous JavaScript function in order to prevent collisions with the use of $ Within the plug-in ‘this’ refers to the jQuery object
AJAX Helpers load, get, getJSON, getScript, post (all use $.ajax behind the scenes) $.ajaxSetup(options) can be used to globally set the default options for all AJAX request. You can still override these within each AJAX request object. Local Events – subscribed to within AJAX request object Global Events – broadcast to all elements in the DOM Can be disabled within the AJAX request object’s ‘global’ property .bind(‘ajaxStart’, fn) or .ajaxStart(fn) G | ajaxStart L | beforeSend G | ajaxSend L | success G | ajaxSuccess L | error G | ajaxError L | complete G | ajaxComplete G | ajaxStop
Utility Functions Array and Object Operations $.each(object, callback) – Callback function will run for each item in the object. The each method is meant to be an immutable iterator and returns the original array. $.map(array, callback) – Callback function will run for each item in the array. The map method can be used as an iterator, but is designed to be used for manipulation of the supplied array and returns a new array. $.merge(first, second) – Merges the second array into the first array. $.unique(array) – Removes duplicate elements (only works on arrays of DOM elements). $.extend(object) – Add functions into the jQuery namespace. $.extend(deep, target, object1, objectN) – Merge values from objects 1 to N into target object. Deep is an optional boolean that if true, tells jQuery to do a deep copy. $.grep(array, callback, invert) – Iterates through array, and returns a new array with values from the original array that satisfy the criteria specified in the callback. $.inArray(value, array) – Gets the index of the value in the array (-1 if not found). String Operations $.trim(str) – Removes whitespace from the given string. Test Operations $.isArray(obj) – Determines if the object is an array. $.isFunction(obj) – Determines if the object is a function.
jQuery Data Can store data on one or more jQuery elements .data(name, value) value is an object Retrieves data from the first element in the jQuery object .data(name)
Resources jQuery Main http://jquery.com http://docs.jquery.com/Downloading_jQuery jQuery API Documentation http://api.jquery.com http://docs.jquery.com jQuery UI http://jqueryui.com http://jqueryui.com/themeroller/ jQuery Blog http://blog.jquery.com/ Around The Web http://stackoverflow.com http://www.nettuts.com http://www.smashingmagazine.com Tools Visual Studio JavaScript Intellisense Support (KB958502) http://getfirebug.com/ (Firebug Firefox Plug-in) http://jsbin.com/  (JS Bin - Collaborative JavaScript Debugging) Twitter @jquery, @jqueryui, @jresig, @rem, @codylindley , @reybango, @elijahmanor, @jamespadolsey, @brandonaaron, @malsup, @pbakaus, @rworth
jQuery

Mais conteúdo relacionado

Mais procurados

Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4
sotlsoc
 

Mais procurados (9)

JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and Lodash
 
Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscore
 
Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4
 
Wicket KT part 2
Wicket KT part 2Wicket KT part 2
Wicket KT part 2
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
Introduction to-scala
Introduction to-scalaIntroduction to-scala
Introduction to-scala
 
jQuery 1.7 visual cheat sheet
jQuery 1.7 visual cheat sheetjQuery 1.7 visual cheat sheet
jQuery 1.7 visual cheat sheet
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
ハイブリッド言語Scalaを使う
ハイブリッド言語Scalaを使うハイブリッド言語Scalaを使う
ハイブリッド言語Scalaを使う
 

Destaque (6)

Kaleehume 3222
Kaleehume 3222Kaleehume 3222
Kaleehume 3222
 
Livejournal
LivejournalLivejournal
Livejournal
 
Sawwan desire 1_3
Sawwan desire 1_3Sawwan desire 1_3
Sawwan desire 1_3
 
Sawwan desire 1-3
Sawwan desire 1-3Sawwan desire 1-3
Sawwan desire 1-3
 
Livejournal
LivejournalLivejournal
Livejournal
 
Mueller n 1_22_2-1
Mueller n 1_22_2-1Mueller n 1_22_2-1
Mueller n 1_22_2-1
 

Semelhante a jQuery

J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
rsnarayanan
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
Allan Huang
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
azz71
 
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptxMicrosoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdfUnit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 

Semelhante a jQuery (20)

jQuery
jQueryjQuery
jQuery
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 
A to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperA to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java Developer
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
 
jQuery
jQueryjQuery
jQuery
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
 
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
 
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptxMicrosoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
 
jQuery-1-Ajax
jQuery-1-AjaxjQuery-1-Ajax
jQuery-1-Ajax
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
jQuery-1-Ajax
jQuery-1-AjaxjQuery-1-Ajax
jQuery-1-Ajax
 
droidparts
droidpartsdroidparts
droidparts
 
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...
 
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdfUnit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
 
J query training
J query trainingJ query training
J query training
 
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
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
Ruby tricks2
Ruby tricks2Ruby tricks2
Ruby tricks2
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
"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 ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

jQuery

  • 1. jQuery Jon Erickson @jonerickson http://jonerickson.me/ http://jonerickson.me/jquery/
  • 2. What is jQuery? JavaScript framework that makes your life easier Selectors & Chaining DOM Traversing DOM Manipulation Event Handling Animations/Effects AJAX Built-in Utilities Extensible Tons of plug-ins built by the community for our use
  • 3. Why jQuery? I’m not an expert at JavaScript The people who created jQuery are! Do not need to worry about cross-browser issues (all abstracted) Light Weight (19 kb compressed) DRY – Simple plug-in model allows for code reuse Animations/Effects are simple Community support is growing rapidly Microsoft adoption (included in MVC template) Tutorials, plug-ins, etc. Client-side scripting is fun with jQuery and breathes some new life into your applications Focus more on the code that solves your problem Amazon, BBC, Dell, Google, IBM, NBC, Netflix, Twitter
  • 4. Sample jQuery Our DOM Include jQuery The ‘ready event’ – Binds a function to be executed whenever the DOM is ready Select the ‘toggleContent’ DOM element and bind a click event handler to it. Select the ‘content’ DOM element and set the text to ‘Hello World!’ Prevent the default behavior of the anchor tag by returning false
  • 5. Dollar Function $(); JavaScript identifiers can start with $ The jQuery framework automatically assigns ‘$’ to the ‘jQuery’ function $ === jQuerytrue $(selector) is same as jQuery(selector) Can use utility function to unassign $ $.noConflict(); $ === jQuery; false Can reassign jQuery to another variable $j = $.noConflict(); $j === jQuery; true $j === $; false $ === jQuery; false
  • 6. Document Ready Event $(document).ready(fn); The bound function will be called the instant the DOM is ready to be read and manipulated. As many as you want on the page. Executed in the order they were added. There is a shortcut: $(fn);
  • 8. Filters $(‘div:empty’), $(‘:empty’), $(‘div:not(:empty)’) Custom Filter Used
  • 9. Chaining Most jQuery methods return another jQuery object (usually the same collection), which means you can chain method calls together with a fluent like syntax Some methods that stop a chain, these methods return a value from the jQuery object .css(name), .text(), .html(), .val(), .height(), .width(), .is(‘:visible’) Some methods will return a different jQuery collection, you can revert to the previous collection by calling .end();
  • 10. Attributes & Classes Getters & Setters for attr, html, text, val Getter (returns String – breaks chain) var text = $(‘#myDiv’).text(); Setter (returns jQuery) $(‘#myDiv’).text(‘Hello World!’); text() escapes html() val() used with inputs attr() can take JSON Add, Remove for Attributes & Classes .removeAttr(‘someAttr’); .addClass(‘someClass’); .removeClass(‘someClass’); .toggleClass(‘someClass’);
  • 11. Traversing Family parent, parents, siblings, children Proximity closest, next, prev, nextAll, prevAll Searching find
  • 12.
  • 13. Manipulation Inserting Inside append, prepend appendTo, prependTo Inserting Outside after, before insertAfter, insertBefore Inserting Around wrapInner wrap wrapAll Replacing replaceWith, replaceAll Removing empty, remove Copying clone
  • 14. Effects Basics show, hide, toggle Sliding slideUp, slideDown, slideToggle Fading fadeIn, fadeOut, fadeTo (opacity 0-1) Custom animate, stop
  • 15. Plug-ins Extremely Simple – Promotes code reuse and DRY principle $.fn.MyPlugin = function(params) {}; Return a jQuery object to prevent from “breaking the chain” Unless you are returning a specific value Best Practice is to wrap the plug-in declaration within an anonymous JavaScript function in order to prevent collisions with the use of $ Within the plug-in ‘this’ refers to the jQuery object
  • 16. AJAX Helpers load, get, getJSON, getScript, post (all use $.ajax behind the scenes) $.ajaxSetup(options) can be used to globally set the default options for all AJAX request. You can still override these within each AJAX request object. Local Events – subscribed to within AJAX request object Global Events – broadcast to all elements in the DOM Can be disabled within the AJAX request object’s ‘global’ property .bind(‘ajaxStart’, fn) or .ajaxStart(fn) G | ajaxStart L | beforeSend G | ajaxSend L | success G | ajaxSuccess L | error G | ajaxError L | complete G | ajaxComplete G | ajaxStop
  • 17. Utility Functions Array and Object Operations $.each(object, callback) – Callback function will run for each item in the object. The each method is meant to be an immutable iterator and returns the original array. $.map(array, callback) – Callback function will run for each item in the array. The map method can be used as an iterator, but is designed to be used for manipulation of the supplied array and returns a new array. $.merge(first, second) – Merges the second array into the first array. $.unique(array) – Removes duplicate elements (only works on arrays of DOM elements). $.extend(object) – Add functions into the jQuery namespace. $.extend(deep, target, object1, objectN) – Merge values from objects 1 to N into target object. Deep is an optional boolean that if true, tells jQuery to do a deep copy. $.grep(array, callback, invert) – Iterates through array, and returns a new array with values from the original array that satisfy the criteria specified in the callback. $.inArray(value, array) – Gets the index of the value in the array (-1 if not found). String Operations $.trim(str) – Removes whitespace from the given string. Test Operations $.isArray(obj) – Determines if the object is an array. $.isFunction(obj) – Determines if the object is a function.
  • 18. jQuery Data Can store data on one or more jQuery elements .data(name, value) value is an object Retrieves data from the first element in the jQuery object .data(name)
  • 19. Resources jQuery Main http://jquery.com http://docs.jquery.com/Downloading_jQuery jQuery API Documentation http://api.jquery.com http://docs.jquery.com jQuery UI http://jqueryui.com http://jqueryui.com/themeroller/ jQuery Blog http://blog.jquery.com/ Around The Web http://stackoverflow.com http://www.nettuts.com http://www.smashingmagazine.com Tools Visual Studio JavaScript Intellisense Support (KB958502) http://getfirebug.com/ (Firebug Firefox Plug-in) http://jsbin.com/ (JS Bin - Collaborative JavaScript Debugging) Twitter @jquery, @jqueryui, @jresig, @rem, @codylindley , @reybango, @elijahmanor, @jamespadolsey, @brandonaaron, @malsup, @pbakaus, @rworth

Notas do Editor

  1. Demo
  2. Demo
  3. Demo
  4. Demo
  5. Demo
  6. Demo
  7. Demo
  8. Demo