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
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The Benefits of Vanilla JavaScript (for the jQuery Developer)
Nate Conley
September 12, 2017
More Decks by Nate Conley
See All by Nate Conley
wp_enqueue_scripts
nateconley
0
52
webpack for WordPress
nateconley
0
150
Other Decks in Technology
See All in Technology
Digital Credentials API × OpenID4VP ブラウザ完結型本人確認の実装知見(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
250
The Django UUID Story - DjangoCon US 2026
pauloxnet
0
260
Kiro Crew で始める マルチエージェント開発
miu_crescent
PRO
0
180
暗号化?某ファイルストレージはどうなるの!? 3rd Partyとうまく付き合う秘密度ラベル設計
kasada
0
200
AIで変わるエンジニアの働き方(仮)
naoinaoi
0
540
Kiro5兄弟のいまどきのセキュリティ基礎知識
kentapapa
0
240
作って理解するCoding Agent 〜フレームワークに頼らないピュア Python での実装〜
takapy
4
1.3k
dbt in Microsoft Fabric
ryomaru0825
0
250
形式手法特論:Hyperproperty とモデル検査 #kernelvm / Kernel VM Study Tokyo 19th
ytaka23
0
810
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
[potatotips #96] Give Your AI Agent the Flutter Playbook
korodroid
0
170
AI時代の「OAuth認証」にどう物申すか?(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
250
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Ethics towards AI in product and experience design
skipperchong
2
350
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Being A Developer After 40
akosma
91
590k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Are puppies a ranking factor?
jonoalderson
2
3.8k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
430
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
Building an army of robots
kneath
306
46k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
210
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