MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/JavaScriptTips/comments/1h2soxb/jquerys_load_in_pure_javascript/lzlskv7/?context=3
r/JavaScriptTips • u/A35G_it • Nov 29 '24
5 comments sorted by
View all comments
4
A couple of improvements:
It's better to use const rather than let or var
const
let
var
It might be better to use the more modern, and simpler, fetch, rather than the older, and more verbose XMLHttpRequest or ActiveXObject.
fetch
XMLHttpRequest
ActiveXObject
1 u/A35G_it Nov 29 '24 Thanks, I used XMLHttpRequest to write a different version of function 😁I will follow your advice to update the code 👍
1
Thanks, I used XMLHttpRequest to write a different version of function 😁
I will follow your advice to update the code 👍
4
u/abrahamguo Nov 29 '24
A couple of improvements:
It's better to use
constrather thanletorvarIt might be better to use the more modern, and simpler,
fetch, rather than the older, and more verboseXMLHttpRequestorActiveXObject.