Monday, October 27, 2014

JQuery refresher

The sprint is wrapping up so why not spend a bit of time polishing my skillset... so lets do the code school course about JQuery.  The thing I have always loved about JQuery is the documentation.  The documentation of the library is a shining example for all other open source libraries.

Neat things I didn't know about even though working with JQuery for years well these are actually CSS things:

  • The child selector - Select only the child elements not all matching descendants.
    • Example: $("#destinations > li");
    • This is very cool.  I knew it was that easy to do.  Normally I would just give everything and id of class to get around this but I like this method of getting the children or use JQuery traversal.
    • Actually this is a CSS selector I did not know about.
  • Select multiple items - You can use one selector to select multiple items with different criteria.
    • Example: $(".promo, #france");
    • Again very cool.  This is something I likely could have used in the past when I used multiple selection statements or gave all the elements the same class.
    • Actually this is a CSS selector I did knew about but never thought about applying in JQuery.

I heart Code School.

No comments:

Post a Comment