SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Sreenath H B
                                 +91 988 646 5897
                                 mail@sreenath.net
© Copyright SREENATH H B, 2011
                                 http://sreenath.net
jQuery Overview
        What is jQuery actually?
        How browsers see HTML
        JSON Overview
        Downloading jQuery
        Including jQuery in your pages
        Hello World




© Copyright SREENATH H B, 2011
                                         2
Selectors – The Heart of jQuery
        Element Selector
            $(“element”)
        ID Selector
            $(“#id”)
        Class Selector
            $(“.classname”)
        Ancestor Descendant
         $(“E F”)
        Parent Child
         $(“E > F”)
        Siblings – Adjacent & General
         Adjacent Sibling : $(“E + F”)
         General Siblings : $(“E ~ F”);
        Multiple Selectors
         $(“E, F, G”)

© Copyright SREENATH H B, 2011
                                          3
Selectors Contd..
        :first-child, :last:child, :only-child :nth-child(n)
         $(“li:first-child”);
         $(“tr:last-child”);
         $(“img:only-child”);
         $(“tr:nth-child(2n)”);
        Attribute Selectors
         Has Attribute: $(“img[alt]”);
         Begins With: $(“a[href^=mailto:]”);
         Ends With: $(“a[href$=.pdf]”);
         Contains: $(“a[href*=microsoft]”);
         Equals: $(“:checkbox[checked=true]”)
        :not(s), :empty, :eq(n), :contains(s)
        :even, :odd




© Copyright SREENATH H B, 2011
                                                               4
jQuery Tid-Bits
        The jQuery Object
        Looping with each();
        this
        Chaining
        Closures
        Accessing DOM Objects
                 Array Subscript – Unsafe
                 .get(n)
        Making peace with other libraries – noConflict()
        Caching for performance




© Copyright SREENATH H B, 2011
                                                           5
DOM Traversal
        .filter()
        .siblings()
        .parent(), .children(), .parents()
        .next(), .nextAll(), .prev(), .prevAll(), .andSelf()
        .find()

   Manipulating Styles
        .addClass()
        .removeClass()
        .css(“height”, “35px”)




© Copyright SREENATH H B, 2011
                                                               6
Events
 Unobtrusive Programming
 Capturing vs. Bubbling; StopPropagation, preventDefault
 The Universal Page Load
 Binding Events to Elements, Triggering Events via Code
 Shorthands
     Blur, focus, select
     Change
     Click, Dblclick
     Mousedown, mouseup, mouseover, mouseout, mousemove
     Keyup, keydown, keypress
     Select
 Event Handler Context
 Passing additional parameters to events
 Compound Events
     Toggle, Hover
 Live, Die & Delegate!             © Copyright SREENATH H B, 2011   7
Effects & Animations
        Hide, Show
        fadeIn, fadeOut
        Toggle
        slideUp, slideDown
        slideToggle
        .animate()




© Copyright SREENATH H B, 2011
                                 8
Working with Forms
        Form Selectors
                 :text
                 :checkbox
                 :radio
                 :image
                 :submit
                 :reset
                 :password
                 :file
                 :input
                 :button
                 :enabled
                 :disabled
                 :checked
                 :selected

© Copyright SREENATH H B, 2011
                                 9
DOM Manipulation
        .text()
        .html()
        .val()
        .append(), prepend()
        .remove()
        .empty()
        .attr(), .removeAttr()
        addClass(), removeClass()
        Creating DOM Nodes
        insertAfter, after, insertBefore, before
        prependTo, appendTo
        .wrap()



© Copyright SREENATH H B, 2011
                                                   10
AJAX
        .load(“a.html”)
        .getJSON(“b.json”);
        .get(“c.xml”);
        .post(“d.php”);
        .ajax({
                                 url:””,
                                  type:”GET”,
                                 dataType: “html”,
                                 success: function(data){
                                           },
                                 error: function(xhr){
                                           }
                    })



© Copyright SREENATH H B, 2011
                                                            11
Authoring Plugins
   (function($){
      $.fn.myPlugin = function(options){
            var defaults = { };
            options = $.extend(defaults, options);

                    return this.each(function(){
                             //My Code for selected elements
                    });
       }
   })(jQuery);

   //Calling
   $(“selector”).myPlugin({options})


© Copyright SREENATH H B, 2011
                                                               12
jQuery Best Practices – Tips & Tricks
        Select directly using an ID selector where possible
        Cache objects if using repeatedly
        Chain as long as possible
        Reduce Direct DOM Manipulation
        Be wary of selectors in loops or each()
        Leverage Event Delegation where possible
        Defer loading to window.load
        Don’t use jQuery where its not needed!
        Conditionally loading jQuery locally




© Copyright SREENATH H B, 2011
                                                              13
References
 Dive Into Accessibility
     http://diveintoaccessibility.org/
 Dive into HTML5
     http://diveintohtml5.org/
 Books
     Pro JavaScript Design Patterns by Dustin Diaz
     Object Oriented JavaScript by Stoyan Stefanov
     Advanced JavaScript 3rd Ed by Chuck Easttom
     Learning jQuery 1.3




                                                     14

Mais conteúdo relacionado

Semelhante a jQuery Training

jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue AdventureAllegient
 
Jquery optimization-tips
Jquery optimization-tipsJquery optimization-tips
Jquery optimization-tipsanubavam-techkt
 
Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++ubshreenath
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And TricksLester Lievens
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQueryPhDBrown
 
Web Development Introduction to jQuery
Web Development Introduction to jQueryWeb Development Introduction to jQuery
Web Development Introduction to jQueryLaurence Svekis ✔
 
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 KatzMarakana Inc.
 
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 Libraryrsnarayanan
 
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
 
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 .NETJames Johnson
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationMevin Mohan
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
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
 
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 .NETJames Johnson
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 

Semelhante a jQuery Training (20)

jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
Jquery optimization-tips
Jquery optimization-tipsJquery optimization-tips
Jquery optimization-tips
 
Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++Web Front End - (HTML5, CSS3, JavaScript) ++
Web Front End - (HTML5, CSS3, JavaScript) ++
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And Tricks
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQuery
 
Web Development Introduction to jQuery
Web Development Introduction to jQueryWeb Development Introduction to jQuery
Web Development Introduction to jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to 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
 
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
 
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
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Lec 5
Lec 5Lec 5
Lec 5
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
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 Overview
JQuery OverviewJQuery Overview
JQuery Overview
 
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
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

jQuery Training

  • 1. Sreenath H B +91 988 646 5897 mail@sreenath.net © Copyright SREENATH H B, 2011 http://sreenath.net
  • 2. jQuery Overview What is jQuery actually? How browsers see HTML JSON Overview Downloading jQuery Including jQuery in your pages Hello World © Copyright SREENATH H B, 2011 2
  • 3. Selectors – The Heart of jQuery Element Selector $(“element”) ID Selector $(“#id”) Class Selector $(“.classname”) Ancestor Descendant $(“E F”) Parent Child $(“E > F”) Siblings – Adjacent & General Adjacent Sibling : $(“E + F”) General Siblings : $(“E ~ F”); Multiple Selectors $(“E, F, G”) © Copyright SREENATH H B, 2011 3
  • 4. Selectors Contd.. :first-child, :last:child, :only-child :nth-child(n) $(“li:first-child”); $(“tr:last-child”); $(“img:only-child”); $(“tr:nth-child(2n)”); Attribute Selectors Has Attribute: $(“img[alt]”); Begins With: $(“a[href^=mailto:]”); Ends With: $(“a[href$=.pdf]”); Contains: $(“a[href*=microsoft]”); Equals: $(“:checkbox[checked=true]”) :not(s), :empty, :eq(n), :contains(s) :even, :odd © Copyright SREENATH H B, 2011 4
  • 5. jQuery Tid-Bits The jQuery Object Looping with each(); this Chaining Closures Accessing DOM Objects Array Subscript – Unsafe .get(n) Making peace with other libraries – noConflict() Caching for performance © Copyright SREENATH H B, 2011 5
  • 6. DOM Traversal .filter() .siblings() .parent(), .children(), .parents() .next(), .nextAll(), .prev(), .prevAll(), .andSelf() .find() Manipulating Styles .addClass() .removeClass() .css(“height”, “35px”) © Copyright SREENATH H B, 2011 6
  • 7. Events Unobtrusive Programming Capturing vs. Bubbling; StopPropagation, preventDefault The Universal Page Load Binding Events to Elements, Triggering Events via Code Shorthands Blur, focus, select Change Click, Dblclick Mousedown, mouseup, mouseover, mouseout, mousemove Keyup, keydown, keypress Select Event Handler Context Passing additional parameters to events Compound Events Toggle, Hover Live, Die & Delegate! © Copyright SREENATH H B, 2011 7
  • 8. Effects & Animations Hide, Show fadeIn, fadeOut Toggle slideUp, slideDown slideToggle .animate() © Copyright SREENATH H B, 2011 8
  • 9. Working with Forms Form Selectors :text :checkbox :radio :image :submit :reset :password :file :input :button :enabled :disabled :checked :selected © Copyright SREENATH H B, 2011 9
  • 10. DOM Manipulation .text() .html() .val() .append(), prepend() .remove() .empty() .attr(), .removeAttr() addClass(), removeClass() Creating DOM Nodes insertAfter, after, insertBefore, before prependTo, appendTo .wrap() © Copyright SREENATH H B, 2011 10
  • 11. AJAX .load(“a.html”) .getJSON(“b.json”); .get(“c.xml”); .post(“d.php”); .ajax({ url:””, type:”GET”, dataType: “html”, success: function(data){ }, error: function(xhr){ } }) © Copyright SREENATH H B, 2011 11
  • 12. Authoring Plugins (function($){ $.fn.myPlugin = function(options){ var defaults = { }; options = $.extend(defaults, options); return this.each(function(){ //My Code for selected elements }); } })(jQuery); //Calling $(“selector”).myPlugin({options}) © Copyright SREENATH H B, 2011 12
  • 13. jQuery Best Practices – Tips & Tricks Select directly using an ID selector where possible Cache objects if using repeatedly Chain as long as possible Reduce Direct DOM Manipulation Be wary of selectors in loops or each() Leverage Event Delegation where possible Defer loading to window.load Don’t use jQuery where its not needed! Conditionally loading jQuery locally © Copyright SREENATH H B, 2011 13
  • 14. References Dive Into Accessibility http://diveintoaccessibility.org/ Dive into HTML5 http://diveintohtml5.org/ Books Pro JavaScript Design Patterns by Dustin Diaz Object Oriented JavaScript by Stoyan Stefanov Advanced JavaScript 3rd Ed by Chuck Easttom Learning jQuery 1.3 14