A little bit of plain JavaScript can do a lot
1–10 of 206 posts
Re: A little bit of plain JavaScript can do a lot
#2The modernization of the DOM API in the last 5 years has done a lot to remove the need for jQuery et al, and has made building the View part of JavaScript apps much more frictionless.
Re: A little bit of plain JavaScript can do a lot
#3More specifically, how JavaScript can do a lot in browser by interacting through the DOM API. The modernization of the DOM API in the last 5 years has done a lot to remove the need for jQuery et al, and has made building the View part of JavaScript apps much more frictionless.
Re: A little bit of plain JavaScript can do a lot
#4Might be good time to also mention these sites:
Re: A little bit of plain JavaScript can do a lot
#5Re: A little bit of plain JavaScript can do a lot
#6Re: A little bit of plain JavaScript can do a lot
#7 const $T = text => document.createTextNode(text)
function $E(tag, props, kids) {
const elem = document.createElement(tag)
for (const k in props) {
elem[k] = props[k]
}
for (const kid of kids) {
elem.appendChild(kid)
}
return elem
}
(Add flourishes as necessary for things like optional arguments and allowing falsey kids.)This isn’t as nice as JSX, but it makes a reasonably ergonomic API for quick little projects. Here’s what the example in the article would look like (admittedly it’s a bit easier to follow with syntax highlighting):
const button = $E('button', {}, [
$E('i', {className: 'icon-lightbulb'}, []),
$T('I learned something!'),
$E('object', {data: '/confetti.svg', width: 30, height: 30}, []),
]);Re: A little bit of plain JavaScript can do a lot
#8More specifically, how JavaScript can do a lot in browser by interacting through the DOM API. The modernization of the DOM API in the last 5 years has done a lot to remove the need for jQuery et al, and has made building the View part of JavaScript apps much more frictionless.
Where can we learn about this “modern JS“? I feel like in some ways I’m learning the old ways, similar to old c++.
Re: A little bit of plain JavaScript can do a lot
#9More specifically, how JavaScript can do a lot in browser by interacting through the DOM API. The modernization of the DOM API in the last 5 years has done a lot to remove the need for jQuery et al, and has made building the View part of JavaScript apps much more frictionless.
Where can we learn about this “modern JS“? I feel like in some ways I’m learning the old ways, similar to old c++.
Re: A little bit of plain JavaScript can do a lot
#10This is super super minor but it's JavaScript not Javascript. IMO the camel case makes it look so much better :D