SlideShare a Scribd company logo
1 of 21
Introduction to JQuery Muhammad Afzal Microsoft Certified Technology Specialist
Introducing the jQuery Library jQuery is simply a file of JavaScript code that allows you to more easily write JavaScript code that runs in many different browsers. This code can do many things; it can work with UI styles,handleuser events, animate parts of your page, call back to the server via AJAX, and more. It is all about selecting the DOM elements , traversing through them and manipulating them. jQueryis one of the most popular and widely used framework. Even Microsoft has also contributed towards it.
Selecting DOM elements
Selection of DOM elements Select by element Finds all elements with a specified tag name and returns an array of those elements. You simply pass the name of the tag to the selector function, as in $("h2"). Select by ID Allows you to select a single element by its ID. You use the pound (#) character to indicate that you are searching by ID. For example, the element, <span id="someId"> can be searched for by using the function call $("#someId"). Select by cascading style sheet Allows you to find all tags with a specific cascading style sheet class name. You use a period (.) to indicate the class name. For example, to find all elements with the cascading style sheet class name of userInputStyle (as in <div class="userInputStyle">), you would use the $(".userInputStyle") selector.
Writing your first jQuery Demo1
jQuery Selector Examples $("h2:first") Used to find the first instance of the <h2> element. Similar syntax can be used for last, odd, and even. $("div:first-child") Used to select the all first child elements inside <div> tags on the page. Similar syntax can be used with last-child. $("#div1:nth-child(4)") Used to select the fourth child element inside the tag whose ID is div1. $("span:not(.sectionHead)") Used to select all <span/> tags that do not have the sectionHeadcascading style sheet class. $(":enabled") Returns all enabled elements on the page. The same syntax can also be used for disabled. $(":checked") Returns all checkbox elements on the page that are checked. Similar syntax can be used for selected items in a list. $("div:hidden") Returns all hidden <div/> tags on the page. Similar syntax can be used for visible. $(":contains(.docx)") Used to find all elements on the page that contain the text .docx. $("#div1 #div2") Finds any <div/> tags with the ID of div2 nested inside another <div/> tag with the ID of div1. $(":button") Used to find all elements of type button. You can use similar syntax with input, text, password, radio, submit, checkbox and image.
Traversing DOM elements
Traversing of DOM elements The result returned by a jQuery selector is a set of elements that match the selection criteria. Even if you only get a single element back in your selection, jQuery gives you a set of elements. This allows you to work with a single item or a collection of items by using the same syntax. Eg: $("h2").each(function (index) { ...
Traversing and manipulation of DOM elements Demo2
jQuery Traversing Examples $("span").get(0) $("span")[0] The .get() function allows you to select a single item inside a result set. Both lines of code search the DOM for all <span/> tags and return the first item inside the set of found items. var items = $("h2").size(); The .size function allows you to determine the number of elements in the result set. This code returns the number of found items and sets the value to a variable. $("h2").add("span").css("color", "green"); The .add() function allows you to add things to found items. This code finds all <h2/> elements and adds a <span/> tag with the cascading style sheet colorstyle set to green. You can use the .add() function to add selected elements, HTML fragments, another element, and more. $("h2").eq(1).css("color", "green"); The .eq() function allows you to cut down the size of your result set to a single item from the returned set. This code selects the second <h2/> item and turns it green. (Note that the index is zero based.)
Handling Client side Events
Client side Events The jQuery language allows you to bind scripts to client-side events such as button clicks,mousemovement, and keyboard interaction. These are the simple event handler registration methods jQuerydefines following events blur() focusin() mousedown() mouseup() change() focusout() mouseenter() resize() click() keydown() mouseleave() scroll() dblclick() keypress() mousemove() select() error() keyup() mouseout() submit() focus() load() mouseover() unload() To event registration syntax is simple $(“#elementname”).bind(“eventname”,”eventhandlder”) The unbind method can be used for deregistration of events.
Events handling Demo3
Animations
Effects and Animations The jQuery library provides methods for adding client-side effects to your elements such as show, hide, fade in, and more.  These effects and animations are easy to use. You simply find your elements by using a jQuery search and then call the effect you want.  You can also combine effects in a queue-like manner through method chaining.  This is as simple as adding one method call after another, as in the following fadeIn().fadeOut().fadeIn()
Animation effects Demo4
Implementing Ajax with jQuery
Implementing Ajax The jQuery.ajax() method enables you to call a web service and then update your page with the results.  This method performs an asynchronous HTTP request, passes data to the request, and gets the results. You can use this method for a variety of tasks, including loading and executing a .js file, posting data to a web form, getting the HTML of a page, and sending and receiving XML data. This method takes several name-value pairs as a parameter, called settings. The settings include the URL of your request, the content-type, the HTTP method (GET or POST), and the user name and password of the request. In fact, there are more than 20 settings with which you can work.
Calling Webservice via jQuery Demo5
Resources jQuery official websitehttp://jquery.com My Bloghttp://goldytech.wordpress.com
Questions?

More Related Content

What's hot (20)

JQuery
JQueryJQuery
JQuery
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Javascript Experiment
Javascript ExperimentJavascript Experiment
Javascript Experiment
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
JavaScript
JavaScriptJavaScript
JavaScript
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
jQuery
jQueryjQuery
jQuery
 
J query training
J query trainingJ query training
J query training
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependências
 
Slashdot Tags
Slashdot TagsSlashdot Tags
Slashdot Tags
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
 
jQuery -Chapter 2 - Selectors and Events
jQuery -Chapter 2 - Selectors and Events jQuery -Chapter 2 - Selectors and Events
jQuery -Chapter 2 - Selectors and Events
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery
jQueryjQuery
jQuery
 
Learn css3
Learn css3Learn css3
Learn css3
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Dollar symbol
Dollar symbolDollar symbol
Dollar symbol
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 

Viewers also liked

高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム
高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム
高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステムplatinumhandbook
 
jQuery Tips'n'Tricks
jQuery Tips'n'TricksjQuery Tips'n'Tricks
jQuery Tips'n'TricksNikola Plejic
 
140520 shareability gruppe3
140520 shareability gruppe3140520 shareability gruppe3
140520 shareability gruppe3How Mightwe
 

Viewers also liked (7)

Miigaaaaa
MiigaaaaaMiigaaaaa
Miigaaaaa
 
高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム
高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム
高齢者に優しい自動車開発プロジェクト、福岡発 紙おむつリサイクルシステム
 
Report on Social networking - 2E
Report on Social networking - 2EReport on Social networking - 2E
Report on Social networking - 2E
 
jQuery Tips'n'Tricks
jQuery Tips'n'TricksjQuery Tips'n'Tricks
jQuery Tips'n'Tricks
 
kraken
krakenkraken
kraken
 
Cannabis linköping 2010 12-09, ulf guttormsson
Cannabis  linköping 2010 12-09, ulf guttormssonCannabis  linköping 2010 12-09, ulf guttormsson
Cannabis linköping 2010 12-09, ulf guttormsson
 
140520 shareability gruppe3
140520 shareability gruppe3140520 shareability gruppe3
140520 shareability gruppe3
 

Similar to Introduction to JQuery

Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsEPAM Systems
 
JQuery_and_Ajax.pptx
JQuery_and_Ajax.pptxJQuery_and_Ajax.pptx
JQuery_and_Ajax.pptxAditiPawale1
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxazz71
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryGunjan Kumar
 
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.pdfRAVALCHIRAG1
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQueryLaila Buncab
 
Web Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONSWeb Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONSRSolutions
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And TricksLester Lievens
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginnersIsfand yar Khan
 
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 DeveloperManoj Bhuva
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 

Similar to Introduction to JQuery (20)

jQuery
jQueryjQuery
jQuery
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
JQuery_and_Ajax.pptx
JQuery_and_Ajax.pptxJQuery_and_Ajax.pptx
JQuery_and_Ajax.pptx
 
Jquery
JqueryJquery
Jquery
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
jQuery
jQueryjQuery
jQuery
 
J query
J queryJ query
J query
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
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
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
Web Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONSWeb Development Course - JQuery by RSOLUTIONS
Web Development Course - JQuery by RSOLUTIONS
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And Tricks
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginners
 
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
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Jquery
JqueryJquery
Jquery
 
Jquery
JqueryJquery
Jquery
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Introduction to JQuery

  • 1. Introduction to JQuery Muhammad Afzal Microsoft Certified Technology Specialist
  • 2. Introducing the jQuery Library jQuery is simply a file of JavaScript code that allows you to more easily write JavaScript code that runs in many different browsers. This code can do many things; it can work with UI styles,handleuser events, animate parts of your page, call back to the server via AJAX, and more. It is all about selecting the DOM elements , traversing through them and manipulating them. jQueryis one of the most popular and widely used framework. Even Microsoft has also contributed towards it.
  • 4. Selection of DOM elements Select by element Finds all elements with a specified tag name and returns an array of those elements. You simply pass the name of the tag to the selector function, as in $("h2"). Select by ID Allows you to select a single element by its ID. You use the pound (#) character to indicate that you are searching by ID. For example, the element, <span id="someId"> can be searched for by using the function call $("#someId"). Select by cascading style sheet Allows you to find all tags with a specific cascading style sheet class name. You use a period (.) to indicate the class name. For example, to find all elements with the cascading style sheet class name of userInputStyle (as in <div class="userInputStyle">), you would use the $(".userInputStyle") selector.
  • 5. Writing your first jQuery Demo1
  • 6. jQuery Selector Examples $("h2:first") Used to find the first instance of the <h2> element. Similar syntax can be used for last, odd, and even. $("div:first-child") Used to select the all first child elements inside <div> tags on the page. Similar syntax can be used with last-child. $("#div1:nth-child(4)") Used to select the fourth child element inside the tag whose ID is div1. $("span:not(.sectionHead)") Used to select all <span/> tags that do not have the sectionHeadcascading style sheet class. $(":enabled") Returns all enabled elements on the page. The same syntax can also be used for disabled. $(":checked") Returns all checkbox elements on the page that are checked. Similar syntax can be used for selected items in a list. $("div:hidden") Returns all hidden <div/> tags on the page. Similar syntax can be used for visible. $(":contains(.docx)") Used to find all elements on the page that contain the text .docx. $("#div1 #div2") Finds any <div/> tags with the ID of div2 nested inside another <div/> tag with the ID of div1. $(":button") Used to find all elements of type button. You can use similar syntax with input, text, password, radio, submit, checkbox and image.
  • 8. Traversing of DOM elements The result returned by a jQuery selector is a set of elements that match the selection criteria. Even if you only get a single element back in your selection, jQuery gives you a set of elements. This allows you to work with a single item or a collection of items by using the same syntax. Eg: $("h2").each(function (index) { ...
  • 9. Traversing and manipulation of DOM elements Demo2
  • 10. jQuery Traversing Examples $("span").get(0) $("span")[0] The .get() function allows you to select a single item inside a result set. Both lines of code search the DOM for all <span/> tags and return the first item inside the set of found items. var items = $("h2").size(); The .size function allows you to determine the number of elements in the result set. This code returns the number of found items and sets the value to a variable. $("h2").add("span").css("color", "green"); The .add() function allows you to add things to found items. This code finds all <h2/> elements and adds a <span/> tag with the cascading style sheet colorstyle set to green. You can use the .add() function to add selected elements, HTML fragments, another element, and more. $("h2").eq(1).css("color", "green"); The .eq() function allows you to cut down the size of your result set to a single item from the returned set. This code selects the second <h2/> item and turns it green. (Note that the index is zero based.)
  • 12. Client side Events The jQuery language allows you to bind scripts to client-side events such as button clicks,mousemovement, and keyboard interaction. These are the simple event handler registration methods jQuerydefines following events blur() focusin() mousedown() mouseup() change() focusout() mouseenter() resize() click() keydown() mouseleave() scroll() dblclick() keypress() mousemove() select() error() keyup() mouseout() submit() focus() load() mouseover() unload() To event registration syntax is simple $(“#elementname”).bind(“eventname”,”eventhandlder”) The unbind method can be used for deregistration of events.
  • 15. Effects and Animations The jQuery library provides methods for adding client-side effects to your elements such as show, hide, fade in, and more. These effects and animations are easy to use. You simply find your elements by using a jQuery search and then call the effect you want. You can also combine effects in a queue-like manner through method chaining. This is as simple as adding one method call after another, as in the following fadeIn().fadeOut().fadeIn()
  • 18. Implementing Ajax The jQuery.ajax() method enables you to call a web service and then update your page with the results. This method performs an asynchronous HTTP request, passes data to the request, and gets the results. You can use this method for a variety of tasks, including loading and executing a .js file, posting data to a web form, getting the HTML of a page, and sending and receiving XML data. This method takes several name-value pairs as a parameter, called settings. The settings include the URL of your request, the content-type, the HTTP method (GET or POST), and the user name and password of the request. In fact, there are more than 20 settings with which you can work.
  • 19. Calling Webservice via jQuery Demo5
  • 20. Resources jQuery official websitehttp://jquery.com My Bloghttp://goldytech.wordpress.com

Editor's Notes

  1. This template can be used as a starter file for presenting training materials in a group setting.SectionsRight-click on a slide to add sections. Sections can help to organize your slides or facilitate collaboration between multiple authors.NotesUse the Notes section for delivery notes or to provide additional details for the audience. View these notes in Presentation View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production)Coordinated colors Pay particular attention to the graphs, charts, and text boxes.Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale.Graphics, tables, and graphsKeep it simple: If possible, use consistent, non-distracting styles and colors.Label all graphs and tables.
  2. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  3. This is another option for an Overview slides using transitions.
  4. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  5. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  6. This is another option for an Overview slides using transitions.
  7. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  8. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  9. This is another option for an Overview slides using transitions.
  10. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  11. This is another option for an Overview slides using transitions.
  12. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  13. This is another option for an Overview slides using transitions.
  14. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important.Introduce each of the major topics.To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.