Skip to content

Instantly share code, notes, and snippets.

@loisaidasam
Last active November 4, 2016 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loisaidasam/12740bb2ff86a9228a884b5f1e07e9b7 to your computer and use it in GitHub Desktop.
Save loisaidasam/12740bb2ff86a9228a884b5f1e07e9b7 to your computer and use it in GitHub Desktop.
How to Javascript in 2016

Here I was, all this time, thinking that JQuery was how people still did things.

Apparently Javascript has changed since I last looked, and things are simpler/more baked in.

Here are the new things:

Getting Elements

Where JQuery let you do:

var foo = $('#foo_id');

You can now do:

var foo = document.querySelector('#foo_id');

https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector

AJAX Calls

JQuery had some nice interface for making AJAX calls.

Apparently now there's this new fetch thing:

Class Stuff

https://developer.mozilla.org/en-US/docs/Web/API/Element/classList

Data Stuff

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset

So cool! Welcome to 2016, you guys! Thanks to the GG Bois for learning me!

@Werninator
Copy link

You may want to look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment