SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
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/

Mais conteúdo relacionado

Mais procurados

Crowdsourcing with Django
Crowdsourcing with DjangoCrowdsourcing with Django
Crowdsourcing with DjangoSimon Willison
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j queryMd. Ziaul Haq
 
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)Oleg Zinchenko
 
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 PlayKris Wallsmith
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureGarann Means
 
The Web beyond "usernames & passwords" (OSDC12)
The Web beyond "usernames & passwords" (OSDC12)The Web beyond "usernames & passwords" (OSDC12)
The Web beyond "usernames & passwords" (OSDC12)Francois Marier
 
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 LibrariesSimon Willison
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery ApplicationsRebecca Murphey
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax pluginsInbal Geffen
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Jack Franklin
 
Jquery Best Practices
Jquery Best PracticesJquery Best Practices
Jquery Best Practicesbrinsknaps
 
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 AppsRebecca Murphey
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionjQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionPaul Irish
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Eventsdmethvin
 

Mais procurados (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
 

Destaque

WebGL - 3D in your Browser
WebGL - 3D in your BrowserWebGL - 3D in your Browser
WebGL - 3D in your BrowserPhil Reither
 
HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!Phil Reither
 
Responsive Web Design Patterns
Responsive Web Design PatternsResponsive Web Design Patterns
Responsive Web Design PatternsPhil Reither
 
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...Phil Reither
 

Destaque (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
 

Semelhante a 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 Secretssmueller_sandsmedia
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricksambiescent
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your WorldMatt Gifford
 
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 Knowgirish82
 
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-3luckysb16
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the WorldJonathan Snook
 
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
 
20111014 mu me_j_querymobile
20111014 mu me_j_querymobile20111014 mu me_j_querymobile
20111014 mu me_j_querymobileErik Duval
 
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!Matt Turnure
 
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍민태 김
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Hidenori Fujimura
 
CSS3 and jQuery
CSS3 and jQueryCSS3 and jQuery
CSS3 and jQuerypsophy
 
Using jQuery to Extend CSS
Using jQuery to Extend CSSUsing jQuery to Extend CSS
Using jQuery to Extend CSSChris Coyier
 

Semelhante a 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
 

Último

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
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 future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Último (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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 future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

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/