SlideShare ist ein Scribd-Unternehmen logo
1 von 20
By,
Para Vaishnav
BASIC IDEA


 jQuery   is one type of JavaScript
  library.
 Simplify Web development
  process.
 Used widely.
USP OF JQUERY




JQUERY is an Open
Source
USP OF JQUERY
            JQUERY follows this




For e.g. $(“#deleted”).addClass(“red”).fadeOut(“slow”);
USP OF JQUERY


   JQUERY supports,
Cross-Browser
 Functionality
WHY USE JQUERY?
   Ease of use
         JQUERY is reusable
         -plug and play
         It is Compact
         -no need of writing long long javascript

   AJAX support
       $(“#comments”).load(“/get_comments.php”);


   Creates Effects and Animations
                                                    Next
var xmlhttp;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");    $.post(
}                                                  'ajax_test.php',
xmlhttp.open("POST","ajax_test.asp",true);         { fname : 'Henry', lname : 'Ford' },
xmlhttp.setRequestHeader("Content-                 function(resp) {
type","application/x-wwwform-                      $('#myDiv').html(resp); }
urlencoded");                                      );
xmlhttp.send("fname=Henry&lname=Ford");            Wednesday, September
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status ==
200) {
document.getElementById("myDiv").innerHTML =
xmlhttp.responseText;
}
};
Wednesday, September                                                            Back
   Supports All Versions of CSS
   Size and Speed
   Instant Plug-ins
   Great Documentation
   Large Community
HOW TO USE JQUERY?
   First Download the latest version of JQUERY

.JS file from
  http://jquery.com/

Documentation from
    http://code.google.com/apis/libraries/devguide.html#jquery


Plug-ins from
  http://plugins.jquery.com/
KNOW JQUERY'S PARTS
 Find Some Elements
  {
   $(“DIV”).ADDCLASS(“XYZ”);


   jQuery Object      }
                      Do something with them




For e.g.
$(“p”).addClass(“blue”);


<p class=“blue”>Hello Students</p>
SELECTORS
                     #header{
Imagine any CSS   file      margin : 0
                            }
                     div{
                            margin : 0px;
                            padding : 0px
                            }
                     ul.menu li{
                            …..
                     }



Selecting By Id         $(“#header”)
FILTERS
        Basic Filters :
             :first, :last, :even, :odd, …...
        Content Filters:
             :empty , :contains(text), :has(selector), …..
        Attribute Filters:
             [attribute], [attribute=value], [attribute!=value], …..


For e.g.
$(“#students tr:even”).css(“background-color”, “#dde”)

It selects even elements and change BGcolor of that <td> (index starts from zero)
           Name                   Class                Roll No.           Comment
   Raju                             XII                    2            Good
   Masud                            IX                     1            Good
   Apu                              XII                    3
JQUERY METHODS
   DOM Manipulation
       before(), after(), append(), appendTo(), …..
   Attributes
       css(), addClass(), attr(), html(), val(), …..
   Events
       click(), bind(), unbind(), live(), …..
   Effects
       hide(), fadeOut(), toggle(), animate(), …..
   Ajax
       load(), get(), ajax(),.ajaxStart()…..
DOM MANIPULATION EXAMPLE
           Move all paragraphs in div with id “contents”
                                 <body>
                                           <h1>jQuery</h1>
                                           <p>jQuery is good</p>
                                           <p>jQuery is better</p>
                                           <div id=“contents”></div>
                                           <p>jQuery is the best</p>

                                 </body>

$(“p”).appendTo(“#contents”); will append <p> in <div id=“contents”>
                                           <h1>jQuery</h1>
                                           <div id=“contents”>
                                                    <p>jQuery is good</p>
                                                    <p>jQuery is better</p>
                                                    <p>jQuery is the
                      best</p>
                                           </div>
ATTRIBUTE EXAMPLE
         Make the texts of last paragraph bold

        $(“#contents p:last”).css(“color”, “green”);
 <body>
  <h1>jQuery Dom Manipulation</h1>
   <div id=“contents”>
        <p >jQuery is good</p>
        <p>jQuery is better</p>
        <p style=“color:green”>jQuery is the best</p>
        </div>
 </body>


Also we can Get or Set the values of attributes :
Set : $(“img.logo”).attr(“align”, “left”);
Get : var allignment = $(“img.logo”).attr(“align”);
IMPLEMENTING JQUERY
     We can implement JQUERY in two ways
                  function slideSwitch()
                  {
   From Scratch              var $active = $('#slideshow IMG.active');
                             var $next = $active.next();
                             $next.addClass('active');
                             $active.removeClass('active');
                  }
                   $(function() { setInterval( "slideSwitch()", 5000 ); });




Use ready plug-ins
FROM SCRATCH
USING PLUG-INS
   Download the plug-in (any version)
   Unzip the downloaded file to a folder and put it whichever
    application you are using.
   Add the plug-in's JavaScript and CSS files inside the header
    section of your Web page:
       For e.g
            <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
            <script src="star-rating/jquery.rating.js"></script>

   Change in styles and css according to your needs
   And you are ready to use your customized plug-ins .
SOURCE
   Links :-
   jquery.com
   http://blog.themeforest.net/
   http://code.google.com/apis/libraries/devguide.html#jquery
   http://en.wikipedia.org/wiki/JQuery#Etymology

   E-Books :-
   JQUERY NOVICE TO NINJA
        -earle castledine & craig sharkie
Thank
You

Weitere ähnliche Inhalte

Was ist angesagt? (20)

A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
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...
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Jquery optimization-tips
Jquery optimization-tipsJquery optimization-tips
Jquery optimization-tips
 
jQuery
jQueryjQuery
jQuery
 
Jquery introduction
Jquery introductionJquery introduction
Jquery introduction
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
J query training
J query trainingJ query training
J query training
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Jquery
JqueryJquery
Jquery
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 

Ähnlich wie Jquery

Jquery presentation
Jquery presentationJquery presentation
Jquery presentationMevin Mohan
 
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 presentationguest5d87aa6
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorialBui Kiet
 
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
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4Heather Rock
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Ayes Chinmay
 
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
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Jack Franklin
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibilityEb Styles
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Componentscagataycivici
 

Ähnlich wie Jquery (20)

Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Jquery 2
Jquery 2Jquery 2
Jquery 2
 
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
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorial
 
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
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
 
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 basics
jQuery basicsjQuery basics
jQuery basics
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
 
jQuery Intro
jQuery IntrojQuery Intro
jQuery Intro
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
XQuery Rocks
XQuery RocksXQuery Rocks
XQuery Rocks
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
 
jQuery
jQueryjQuery
jQuery
 

Kürzlich hochgeladen

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
 
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
 
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 WorkerThousandEyes
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
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
 
🐬 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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

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...
 
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
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
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?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Jquery

  • 2. BASIC IDEA  jQuery is one type of JavaScript library.  Simplify Web development process.  Used widely.
  • 3. USP OF JQUERY JQUERY is an Open Source
  • 4. USP OF JQUERY JQUERY follows this For e.g. $(“#deleted”).addClass(“red”).fadeOut(“slow”);
  • 5. USP OF JQUERY JQUERY supports, Cross-Browser Functionality
  • 6. WHY USE JQUERY?  Ease of use JQUERY is reusable -plug and play It is Compact -no need of writing long long javascript  AJAX support  $(“#comments”).load(“/get_comments.php”);  Creates Effects and Animations Next
  • 7. var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); $.post( } 'ajax_test.php', xmlhttp.open("POST","ajax_test.asp",true); { fname : 'Henry', lname : 'Ford' }, xmlhttp.setRequestHeader("Content- function(resp) { type","application/x-wwwform- $('#myDiv').html(resp); } urlencoded"); ); xmlhttp.send("fname=Henry&lname=Ford"); Wednesday, September xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("myDiv").innerHTML = xmlhttp.responseText; } }; Wednesday, September Back
  • 8. Supports All Versions of CSS  Size and Speed  Instant Plug-ins  Great Documentation  Large Community
  • 9. HOW TO USE JQUERY?  First Download the latest version of JQUERY .JS file from http://jquery.com/ Documentation from http://code.google.com/apis/libraries/devguide.html#jquery Plug-ins from http://plugins.jquery.com/
  • 10. KNOW JQUERY'S PARTS Find Some Elements { $(“DIV”).ADDCLASS(“XYZ”); jQuery Object } Do something with them For e.g. $(“p”).addClass(“blue”); <p class=“blue”>Hello Students</p>
  • 11. SELECTORS #header{ Imagine any CSS file margin : 0 } div{ margin : 0px; padding : 0px } ul.menu li{ ….. } Selecting By Id $(“#header”)
  • 12. FILTERS  Basic Filters :  :first, :last, :even, :odd, …...  Content Filters:  :empty , :contains(text), :has(selector), …..  Attribute Filters:  [attribute], [attribute=value], [attribute!=value], ….. For e.g. $(“#students tr:even”).css(“background-color”, “#dde”) It selects even elements and change BGcolor of that <td> (index starts from zero) Name Class Roll No. Comment Raju XII 2 Good Masud IX 1 Good Apu XII 3
  • 13. JQUERY METHODS  DOM Manipulation  before(), after(), append(), appendTo(), …..  Attributes  css(), addClass(), attr(), html(), val(), …..  Events  click(), bind(), unbind(), live(), …..  Effects  hide(), fadeOut(), toggle(), animate(), …..  Ajax  load(), get(), ajax(),.ajaxStart()…..
  • 14. DOM MANIPULATION EXAMPLE Move all paragraphs in div with id “contents” <body> <h1>jQuery</h1> <p>jQuery is good</p> <p>jQuery is better</p> <div id=“contents”></div> <p>jQuery is the best</p> </body> $(“p”).appendTo(“#contents”); will append <p> in <div id=“contents”> <h1>jQuery</h1> <div id=“contents”> <p>jQuery is good</p> <p>jQuery is better</p> <p>jQuery is the best</p> </div>
  • 15. ATTRIBUTE EXAMPLE Make the texts of last paragraph bold $(“#contents p:last”).css(“color”, “green”); <body> <h1>jQuery Dom Manipulation</h1> <div id=“contents”> <p >jQuery is good</p> <p>jQuery is better</p> <p style=“color:green”>jQuery is the best</p> </div> </body> Also we can Get or Set the values of attributes : Set : $(“img.logo”).attr(“align”, “left”); Get : var allignment = $(“img.logo”).attr(“align”);
  • 16. IMPLEMENTING JQUERY We can implement JQUERY in two ways function slideSwitch() { From Scratch var $active = $('#slideshow IMG.active'); var $next = $active.next(); $next.addClass('active'); $active.removeClass('active'); } $(function() { setInterval( "slideSwitch()", 5000 ); }); Use ready plug-ins
  • 18. USING PLUG-INS  Download the plug-in (any version)  Unzip the downloaded file to a folder and put it whichever application you are using.  Add the plug-in's JavaScript and CSS files inside the header section of your Web page:  For e.g <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script src="star-rating/jquery.rating.js"></script>  Change in styles and css according to your needs  And you are ready to use your customized plug-ins .
  • 19. SOURCE  Links :-  jquery.com  http://blog.themeforest.net/  http://code.google.com/apis/libraries/devguide.html#jquery  http://en.wikipedia.org/wiki/JQuery#Etymology  E-Books :-  JQUERY NOVICE TO NINJA -earle castledine & craig sharkie