SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
W

Q r ?
J v Sr
var divs = document.getElementByTagName('div');
for (i = 0; i < divs.length; i++) {
	 divs[i].style.display = ‘none’;
}




 Q r
$('div').hide();
I’
                          fb   w   !
24 KB




        i m ag e
           . jp g
42 KB

                1.6 MB
http://www.google.com/trends?q=jquery%2C+mootools%2C+dojo+javascript%2C+prototype+javascript%2C+yui&ctab=0&geo=all&date=all&sort=0
5000 x
                                                011
                                                                  Around 50% of
                                           09.2

                                                                  the top 10,000
                                                                  websites use
Top 10k Sites using jQuery
                                                                  jQuery.




                             http://blog.builtwith.com/2011/10/31/jquery-version-and-usage-report/
W    I   v
       r
    Q r ?
I                     Q r
<script src="jquery.min.js"></script>

 	               OR

<script src="http://ajax.googleapis.com/
ajax/libs/jquery/1/jquery.min.js">
“   Iw

         w   .
H w   w
w     ?
$("div")

$(".className")

$("#id")

$("input[type=date]")

$("body > nav:last-of-type
ul:not(:has(.product))")
CSS3                              r
$('li + li, section:nth-of-type(3n-1)')
$('img[href*=ad]')




 Q r                                  r
$('li:hidden, a:visible')
$('div:has(p), h2:contains(hello)')
W       w
w
    w   v   ?
$(' v').            ();
  1. find   2. do
// we can call methods on it
$('ul li').hide();

// we can treat it like an array
$('ul li')[0]

// we can iterate over it..
$('ul li').each(function(i, x) {
    console.log($(this));
});
Attributes - css(), attr(), html(), val(), addClass()
Traversing - find(), is(), prevAll(), next(), hasClass()
Events - bind(), trigger(), unbind(), live(), click()
Effects - show(), fadeOut(), toggle(), animate()
Moving Elements - append(), appendTo(), before()
Ajax - get(), getJSON(), post(), ajax(), load()
1                  ,
// returns html content
$('div').html();

// sets html content
$('div').html('<i>whassup</i>');
G                  S
.attr('src') ......	.attr('src', 'image.jpg');

.html() ...........	.html('<h1>hi</h1>');

.text() ...........	.text('text text bla');

.css('margin') ....	.css('margin', '0');

.width() ..........	.width(100);
H w   I
  r
          ?
“   M Q r
    r r
     b .
      “     ”
              r Q r


         r.
$('div')
  .addClass('product')
  .fadeOut()
  .css('margin', 0);
                  end of
                 the line
$('form#login')


    // hide all the labels.optional
    .find('label.optional').hide().end()


    // add a red border to any password
    .find('input:password')
    .css('border', '1px solid red').end()


    // add a submit handler to the form
    .submit(function(){
        return confirm('Are you sure?');
    });


              http://simonwillison.net/2007/Aug/15/jquery/
H w   I
r   HTML
      ?
Cr                  E
// html as a string
$("#element").before(
   '<a class="bla" href="bla"
    onclick="bla;">bla</a>'
);
H w   I
      ff?
$('h1').slideDown();

$('h2').slideDown('fast');

$('h3').fadeOut(2000);

$('h4').fadeOut(2000).slideDown();
W
$(this).fadeOut(1000, function(){
  console.log($(this).text()
    + ' has faded! ');
  $(this).remove();
});
M                  r w
$("#block").animate( {
    width: "+=60px",
    opacity: 0.4,
    fontSize: "3em",
    borderWidth: "10px"
  }, 1500);
H w       I
r         v       ?
$('a:first').click(function(event) {
  $(this).css({color: 'orange'});
  event.preventDefault();
});

$('a:first').click();
w          w.
$(function() {
  console.log('DOM Tree loaded.');
});
H w ffi
   AJAX?
“Asynchronous
JavaScript
and XML”
Daten vom Server holen
ohne die Seite neu zu laden.
J v Sr                             AJAX
var request = new XMLHttpRequest();
request.open('GET', 'http://www.mozilla.org/', false);
request.send(null);

if (request.status == 200) {
  console.log(request.responseText);
}

[...]
AJAX w                Q r
$('#intro').load('/some/file.html');
$.ajax({
  type: 'POST',
  url: 'http://as.d/f.html',
  data: 'name=John&drinks=3',
  cache: false,
  beforeSend: function( xhr ) {
     xhr.overrideMimeType( 'text/
plain; charset=x-user-defined' );
  },
  success: function( data ) {
     console.log( 'w00t!' );
  }
});
XML   JSON
XML     JSON




      XML
XML     JSON




      JSON
R     b r:
   r’
f r vr      !
This is a
              tooltip.




“   q
        f r
    Q r fr    w r .
1.
<script src="qtip-2.0.0.min.js"></script>




2.
<a href=# title="bieber rocks">..</a>
$('a[title]').qtip();
Wr                    r w
jQuery.fn.hideLinks = function() {
    this.find('a[href]').hide();
    return this;
}

$('p').hideLinks();
U                       L
            http://jquery.com/
         http://docs.jquery.com/
    http://docs.jquery.com/Tutorials
       http://plugins.jquery.com/
           http://jqueryui.com/
L                                                 I
     “Can you read this, Luke Skywalker?“ http://www.flickr.com/photos/49462908@N00/4109940538/
“Few people knew that Fett auditioned for a role in Raiders of the Lost Ark (Explore)” http://www.flickr.com/
                                      photos/27271711@N04/3005974444/
               “Pink Storm Cloud” http://www.flickr.com/photos/83346641@N00/3526917649/
                           “Lost” http://www.flickr.com/photos/st3f4n/4392451969/
        “Clone Terror with Jelly Beans” http://www.flickr.com/photos/kalexanderson/5461205156/
                       “Toy Torture” http://www.flickr.com/photos/st3f4n/4222365229/
   “Hard To Tap Dance With Diving Flippers” http://www.flickr.com/photos/47287396@N05/5351991389/
      “Baby care lesson by Darth Vader” http://www.flickr.com/photos/49462908@N00/4370515705/
          “Introducing the Imperial team for the Winter Olympics” http://www.flickr.com/photos/
                                          49462908@N00/4352088960/
            “Everyone’s nightmare” http://www.flickr.com/photos/49462908@N00/4340808219/
           “It’s Fun To Stay At The...” http://www.flickr.com/photos/83346641@N00/3578775702/
                   “Stay active” http://www.flickr.com/photos/99472898@N00/4435490471/

Contenu connexe

Tendances

Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
 
Jquery Best Practices
Jquery Best PracticesJquery Best Practices
Jquery Best Practices
brinsknaps
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionjQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
Paul Irish
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
dmethvin
 

Tendances (20)

PhoneGap: Local Storage
PhoneGap: Local StoragePhoneGap: Local Storage
PhoneGap: Local Storage
 
Crowdsourcing with Django
Crowdsourcing with DjangoCrowdsourcing with Django
Crowdsourcing with Django
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)
 
Love and Loss: A Symfony Security Play
Love and Loss: A Symfony Security PlayLove and Loss: A Symfony Security Play
Love and Loss: A Symfony Security Play
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer Architecture
 
The Web beyond "usernames & passwords" (OSDC12)
The Web beyond "usernames & passwords" (OSDC12)The Web beyond "usernames & passwords" (OSDC12)
The Web beyond "usernames & passwords" (OSDC12)
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
 
Jquery Best Practices
Jquery Best PracticesJquery Best Practices
Jquery Best Practices
 
Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsBeyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
 
BVJS
BVJSBVJS
BVJS
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionjQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
 

En vedette

En vedette (6)

WebGL - 3D in your Browser
WebGL - 3D in your BrowserWebGL - 3D in your Browser
WebGL - 3D in your Browser
 
HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!
 
Responsive Web Design Patterns
Responsive Web Design PatternsResponsive Web Design Patterns
Responsive Web Design Patterns
 
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
 
Web Design Trends 2014
Web Design Trends 2014Web Design Trends 2014
Web Design Trends 2014
 
Top 10 Web Design Trends for 2015
Top 10 Web Design Trends for 2015Top 10 Web Design Trends for 2015
Top 10 Web Design Trends for 2015
 

Similaire à An Introduction to Jquery

international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3
luckysb16
 
20111014 mu me_j_querymobile
20111014 mu me_j_querymobile20111014 mu me_j_querymobile
20111014 mu me_j_querymobile
Erik Duval
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
Hidenori Fujimura
 
Using jQuery to Extend CSS
Using jQuery to Extend CSSUsing jQuery to Extend CSS
Using jQuery to Extend CSS
Chris Coyier
 

Similaire à An Introduction to Jquery (20)

jQuery
jQueryjQuery
jQuery
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your World
 
webstudy jquery
webstudy jquerywebstudy jquery
webstudy jquery
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
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
 
J query training
J query trainingJ query training
J query training
 
20111014 mu me_j_querymobile
20111014 mu me_j_querymobile20111014 mu me_j_querymobile
20111014 mu me_j_querymobile
 
jQuery
jQueryjQuery
jQuery
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
 
So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!
 
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
 
CSS3 and jQuery
CSS3 and jQueryCSS3 and jQuery
CSS3 and jQuery
 
Using jQuery to Extend CSS
Using jQuery to Extend CSSUsing jQuery to Extend CSS
Using jQuery to Extend CSS
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"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 ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

An Introduction to Jquery

  • 1.
  • 3. J v Sr var divs = document.getElementByTagName('div'); for (i = 0; i < divs.length; i++) { divs[i].style.display = ‘none’; } Q r $('div').hide();
  • 4. I’ fb w ! 24 KB i m ag e . jp g 42 KB 1.6 MB
  • 6. 5000 x 011 Around 50% of 09.2 the top 10,000 websites use Top 10k Sites using jQuery jQuery. http://blog.builtwith.com/2011/10/31/jquery-version-and-usage-report/
  • 7. W I v r Q r ?
  • 8. I Q r <script src="jquery.min.js"></script> OR <script src="http://ajax.googleapis.com/ ajax/libs/jquery/1/jquery.min.js">
  • 9. Iw w .
  • 10. H w w w ?
  • 12. CSS3 r $('li + li, section:nth-of-type(3n-1)') $('img[href*=ad]') Q r r $('li:hidden, a:visible') $('div:has(p), h2:contains(hello)')
  • 13. W w w w v ?
  • 14. $(' v'). (); 1. find 2. do
  • 15. // we can call methods on it $('ul li').hide(); // we can treat it like an array $('ul li')[0] // we can iterate over it.. $('ul li').each(function(i, x) { console.log($(this)); });
  • 16. Attributes - css(), attr(), html(), val(), addClass() Traversing - find(), is(), prevAll(), next(), hasClass() Events - bind(), trigger(), unbind(), live(), click() Effects - show(), fadeOut(), toggle(), animate() Moving Elements - append(), appendTo(), before() Ajax - get(), getJSON(), post(), ajax(), load()
  • 17. 1 , // returns html content $('div').html(); // sets html content $('div').html('<i>whassup</i>');
  • 18. G S .attr('src') ...... .attr('src', 'image.jpg'); .html() ........... .html('<h1>hi</h1>'); .text() ........... .text('text text bla'); .css('margin') .... .css('margin', '0'); .width() .......... .width(100);
  • 19. H w I r ?
  • 20. M Q r r r b . “ ” r Q r r.
  • 21. $('div') .addClass('product') .fadeOut() .css('margin', 0); end of the line
  • 22. $('form#login') // hide all the labels.optional .find('label.optional').hide().end() // add a red border to any password .find('input:password') .css('border', '1px solid red').end() // add a submit handler to the form .submit(function(){ return confirm('Are you sure?'); }); http://simonwillison.net/2007/Aug/15/jquery/
  • 23. H w I r HTML ?
  • 24. Cr E // html as a string $("#element").before( '<a class="bla" href="bla" onclick="bla;">bla</a>' );
  • 25. H w I ff?
  • 27. W $(this).fadeOut(1000, function(){ console.log($(this).text() + ' has faded! '); $(this).remove(); });
  • 28. M r w $("#block").animate( { width: "+=60px", opacity: 0.4, fontSize: "3em", borderWidth: "10px" }, 1500);
  • 29. H w I r v ?
  • 30. $('a:first').click(function(event) { $(this).css({color: 'orange'}); event.preventDefault(); }); $('a:first').click();
  • 31. w w. $(function() { console.log('DOM Tree loaded.'); });
  • 32. H w ffi AJAX?
  • 33. “Asynchronous JavaScript and XML” Daten vom Server holen ohne die Seite neu zu laden.
  • 34. J v Sr AJAX var request = new XMLHttpRequest(); request.open('GET', 'http://www.mozilla.org/', false); request.send(null); if (request.status == 200) { console.log(request.responseText); } [...]
  • 35. AJAX w Q r $('#intro').load('/some/file.html');
  • 36. $.ajax({ type: 'POST', url: 'http://as.d/f.html', data: 'name=John&drinks=3', cache: false, beforeSend: function( xhr ) { xhr.overrideMimeType( 'text/ plain; charset=x-user-defined' ); }, success: function( data ) { console.log( 'w00t!' ); } });
  • 37. XML JSON
  • 38. XML JSON XML
  • 39. XML JSON JSON
  • 40. R b r: r’ f r vr !
  • 41. This is a tooltip. “ q f r Q r fr w r .
  • 42. 1. <script src="qtip-2.0.0.min.js"></script> 2. <a href=# title="bieber rocks">..</a> $('a[title]').qtip();
  • 43. Wr r w jQuery.fn.hideLinks = function() { this.find('a[href]').hide(); return this; } $('p').hideLinks();
  • 44. U L http://jquery.com/ http://docs.jquery.com/ http://docs.jquery.com/Tutorials http://plugins.jquery.com/ http://jqueryui.com/
  • 45. L I “Can you read this, Luke Skywalker?“ http://www.flickr.com/photos/49462908@N00/4109940538/ “Few people knew that Fett auditioned for a role in Raiders of the Lost Ark (Explore)” http://www.flickr.com/ photos/27271711@N04/3005974444/ “Pink Storm Cloud” http://www.flickr.com/photos/83346641@N00/3526917649/ “Lost” http://www.flickr.com/photos/st3f4n/4392451969/ “Clone Terror with Jelly Beans” http://www.flickr.com/photos/kalexanderson/5461205156/ “Toy Torture” http://www.flickr.com/photos/st3f4n/4222365229/ “Hard To Tap Dance With Diving Flippers” http://www.flickr.com/photos/47287396@N05/5351991389/ “Baby care lesson by Darth Vader” http://www.flickr.com/photos/49462908@N00/4370515705/ “Introducing the Imperial team for the Winter Olympics” http://www.flickr.com/photos/ 49462908@N00/4352088960/ “Everyone’s nightmare” http://www.flickr.com/photos/49462908@N00/4340808219/ “It’s Fun To Stay At The...” http://www.flickr.com/photos/83346641@N00/3578775702/ “Stay active” http://www.flickr.com/photos/99472898@N00/4435490471/