Intro to jQuery

Welcome!

Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.

Some "rules"

  • We are here for you!
  • Every question is important
  • Help each other
  • Have fun

Welcome!

Tell us about yourself.

  • Who are you?
  • What do you hope to get out of the class?
  • What is your superpower?

Functions in Disguise

The $ (and jQuery), and .addClass() are just functions!


  $('p')
          

  // These are just two functions "chained" together!
  $('p').addClass('special');
          

  Name(argument)

  function(argument)
          

Recap: Getting vs. Setting

Many of jQuery's methods do double-duty.

<p>What's in here?</p>


  $('p').html();  // No argument, will get the value "What's in here?"
          

  $('p').html("Heyo!");  // SETS the value!
          

<p>Heyo!</p>

A Train (Chain) of Functions


  $('p').addClass('special').html('hello!');
          

Summary

  • jQuery is a well-documented library of ready-made javascript functions
  • Can be used to get and change info about html elements or create new elements
  • Best employed to enrich user interactions
  • Widely used for its simple AJAX functionality
  • Many plugins are available in the open source community. Contribute your own!

Questions?

?

Survey

http://bit.ly/gdi-jquery