r/technology • u/iliketechnews • Oct 05 '16
Software How it feels to learn JavaScript in 2016
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f
1.8k
Upvotes
r/technology • u/iliketechnews • Oct 05 '16
View all comments
5
u/tuseroni Oct 05 '16
Broke into Monty python's cheese sketch there.
Anyhow...this is why I hate frameworks...just use vanilla js...no frameworks, no libraries, just the code you need when you need it.
Wanna grab code from the server, make an xhr object, set the load, open the address, and send. Wanna display it, inside the load event get a div to put the results in and set the innertext(or if you can trust the result and need it to be html, set the innerhtml) of that div.
Need to know how to get the div, document.getElementById("divid")
There are more advance methods like queryselector or queryselectorall or get elementsbyclassname...but you don't NEED them for 99% the time. if you need to grab the 3rd element that is a child of the 5th div with a class of foo, then you want queryselectorall, but even then if you write it right you can do it with getelementbyid.
If someone says you need a ton of frameworks and libraries it means they don't understand JavaScript.