Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Benefits of Vanilla JavaScript (for the jQu...
Search
Nate Conley
September 12, 2017
Technology
0
170
The Benefits of Vanilla JavaScript (for the jQuery Developer)
Nate Conley
September 12, 2017
Tweet
Share
More Decks by Nate Conley
See All by Nate Conley
wp_enqueue_scripts
nateconley
0
49
webpack for WordPress
nateconley
0
140
Other Decks in Technology
See All in Technology
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.5k
AI駆動開発を事業のコアに置く
tasukuonizawa
1
290
Context Engineeringの取り組み
nutslove
0
370
コミュニティが変えるキャリアの地平線:コロナ禍新卒入社のエンジニアがAWSコミュニティで見つけた成長の羅針盤
kentosuzuki
0
130
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
980
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
130
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
4
1.3k
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
110
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
370
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
200
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
380
The Cult of Friendly URLs
andyhume
79
6.8k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
Accessibility Awareness
sabderemane
0
53
Navigating Weather and Climate Data
rabernat
0
110
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Are puppies a ranking factor?
jonoalderson
1
2.7k
Transcript
The Benefits of Vanilla JavaScript WordCamp Sacramento 2017 1 (for
the jQuery Developer)
Hi, I’m Nate
I have a confession
I ♥ jQuery
but… sometimes I use it as a crutch
jQuery is awesome!
What do I mean by Vanilla JavaScript?
Why should I even learn Vanilla JavaScript?
Because Matt said so…
Knowing jQuery != Knowing JavaScript
Performance
operations/second Vanilla document.getElementById( ‘app’ ); 12,137,211 jQuery $( ‘#app’ )
350,557 http://vanilla-js.com/
One less dependency to load in the browser
The Future
jQuery Browser Support 1.12.4 (WordPress) - Support for IE6+ 15
3.2.1 (Current) - Support for IE9+
Fancy Frameworks and Libraries
You Might Not Need jQuery…
How Can I Start?
DOM
Selecting DOM Elements $( ‘.some-selector #here’ )
Selecting DOM Elements document.getElementById() document.querySelector() document.querySelectorAll() - Get one element
by ID selector - Get one element by CSS-like selector - Get all elements by CSS-like selector
Selecting DOM Elements document.getElementsByClassName() document.getElementsByName() document.getElementsByTagName() - Get all elements
by class selector - Get all elements by name attribute - Get all elements by HTML tag
Creating DOM Elements document.createElement() element.cloneNode() element.appendChild() - Create an element
by passing it an HTML tag - Clone an element - Append a child
More DOM Topics Traversing the DOM Form Manipulation Styles element.parentNode.firstChild
getSiblings( element ) element.value element.style.backgroundColor = ‘red’
Events
addEventListener Similar to .on(), .click(), etc. in jQuery element.addEventListener( ‘click’,
function() { // Do something } );
AJAX
XMLHttpRequest (XHR) is UGLY
var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if
( xhr.readyState == 4 && xhr.status == 200 ) { // Do something } } xhr.open( ‘GET’, ‘/wp-json/wp/v2/posts’, true ); xhr.send();
Fetch API Supported in major browsers, but no IE11 davidwalsh.name/fetch
fetch( '/wp-json/wp/v2/posts', { method: ‘GET' } ) .then( function( response ) { // Do something } ) .catch( function( error ) { // Do something } );
Live Coding! github.com/nateconley/vanilla-js
Learn More • JavaScript 30 - wesbos.com/javascript30 • Plain JS
- plainjs.com • JavaScript for WordPress - javascriptforwp.com • You Might Not Need jQuery - youmightnotneedjquery.com
Learn More • From jQuery to JavaScript - code.tutsplus.com/ tutorials/from-jquery-to-javascript-a-reference--
net-23703 • Sans jQuery - gist.github.com/joyrexus/7307312 • Wes Bos Resources - wesbos.com/learn-javascript/ • Parallax Done Right - medium.com/@dhg/parallax- done-right-82ced812e61c
@nateconley123 nateconley.com