3 ms·
That's not fair. The article you mention is https://www.w3schools.com/xml/ajax_applications.asp https://www.w3schools.com/xml/ajax_applications.asp, and it come
by onli 8y ago
That's not fair. The article you mention is https://www.w3schools.com/xml/ajax_applications.asp https://www.w3schools.com/xml/ajax_applications.asp, and it comes after a sound and basic introduction of the XMLHttpRequest element.
> find me an XHR example that doesn't use ready State
I absolutely see no problem with using readystate.
> and work objectively less well than their framework (or modern JS) counterparts
Come on, that's silly. What's called modern JS and what those super heavy framework use are in no way objectively better. To confront beginners with all their overhead (build tools for JS! Just crazy) is in no way helpful.
- bastawhiz 8y ago> I absolutely see no problem with using readystate. We have a load event now. Ready state is the legacy cruft left behind by Microsoft a decade ago. Let's not confuse new devs with magic numbers and convoluted events that are often cargo-culted incorrectly. > To confront beginners with all their overhead (build tools for JS! Just crazy) is in no way helpful. People have been dropping a jQuery CDN script tag on their pages since well before most build tools were invented. W3schools has _multiple_ "tutorials" that could be replaced with $('...').load('...'). It's rich when HN complains about websites that do things like break middle click and browser history and lack error states, but then advocate for trash code like w3schools peddles that makes these bad practices more common.
- onli 8y agoIf you are only talking jQuery when referring to frameworks my bloat and build tools arguments don't apply, that was for real frameworks like react. jQuery is fine in that regard, it's just not the modern choice anymore, without being vanilla js. It would be strange to boost a legacy solution like that.