MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/JavaScriptTips/comments/1h2soxb/jquerys_load_in_pure_javascript/lzmuemf/?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 u/abrahamguo I have updated the code, any other suggestions?Thanks a lot 0 u/abrahamguo Nov 29 '24 Yes, if you convert it to TypeScript, you should see some further errors with your code. 2 u/A35G_it Nov 29 '24 Next goal will be that! 👍
1
u/abrahamguo I have updated the code, any other suggestions?
Thanks a lot
0 u/abrahamguo Nov 29 '24 Yes, if you convert it to TypeScript, you should see some further errors with your code. 2 u/A35G_it Nov 29 '24 Next goal will be that! 👍
0
Yes, if you convert it to TypeScript, you should see some further errors with your code.
2 u/A35G_it Nov 29 '24 Next goal will be that! 👍
2
Next goal will be that! 👍
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.