Vanilla JS for Beginners

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Vanilla JS for Beginners

An introduction to vanilla JavaScript, including vanilla JS APIs, browser compatibility, debugging, and more.

Chris Ferdinandi

April 11, 2017

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

52 slides
  1. var supports = 'querySelector' in document && 'addEventListener' in window;

    if ( supports ) { // Codes goes here... } // or... if ( !supports ) return;
  2. Browser Compatibility • IE9+ • Firefox 3.5+ • Opera 9+

    (and probably further back) • Safari 4+ • Chrome 1+ (I think) • iPhone and iPad iOS1+ • Android phone and tablets 2.1+ • Blackberry OS6+ • Windows 7.5+ (new Mango version) • Mobile Firefox (all the versions we tested) • Opera Mobile (all the versions we tested)
  3. “Strict mode makes several changes to normal JavaScript semantics. First,

    strict mode eliminates some JavaScript silent errors by changing them to throw errors.” https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
  4. Project Ideas • Toggle Tabs • Modals • Save Form

    Data • Toggle Password Visibility • Make Content the Same Height • Generate a Table of Contents
  5. ?

More Decks by Chris Ferdinandi

Other Decks in Programming