English subtitles

← How to Use the - Intro to jQuery

Get Embed Code
8 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. So, the dollar sign is just a function.
  2. But, now, what can you do with it?
  3. jQuery returns an array-like object which we call a jQuery collection.
  4. The reason we say it's an array-like object is that it's an object that
  5. looks and behaves like an array, but also includes some additional methods.
  6. You could pass strings into the jQuery object and
  7. a jQuery collection of DOM elements will be returned.
  8. On the Udacity website for instance, I've passed #foo into the jQuery object and
  9. saw an empty array come back.
  10. All right, well, that's not too exciting.
  11. I'll come back to the passing in strings like this in a moment.
  12. But what if you pass in a function?
  13. You could actually do that too.
  14. This is a pretty neat trick that I'll be revisiting at the very
  15. end of this class.
  16. You could pass a DOM element into the jQuery object as well,
  17. if you want to call some jQuery methods on it.
  18. You can call methods directly on the jQuery object, like $.ajax.
  19. $.ajax subtracts away all the annoying nuances of
  20. ajax into a simple method called on the jQuery object.
  21. You can check out the ajax class if you want to learn more.
  22. Notice that I'm just talking about normal JavaScript operations.
  23. It's worth repeating that jQuery is just a JavaScript library.
  24. It's not a language.
  25. The jQuery function takes in some parameters.
  26. It returns an object and even has some methods attached to it,
  27. just like any other JavaScript object.
  28. But that's enough of me talking.
  29. It's time for you to start practicing.