r/ProgrammerHumor 3d ago

Meme ancientTools

Post image
5.8k Upvotes

387 comments sorted by

View all comments

Show parent comments

2

u/SolideMeinung 2d ago

Nope its not just onload or eventlisteners. The ready function of jquery has some corner cases.

Like the first and best one.... when everything is already loaded and ready just fire it.

A lot of people do miss that. Its funny how js developer have so much trouble reimplementing the jquery ready method because they think its easy.

1

u/ExtraWorldliness6916 2d ago

I was referring to DOMContentLoaded. O I was a bit cryptic but I mean that there are multiple ways to match the lifecycle. Still I'm probably, it was a long time ago

1

u/SolideMeinung 2d ago

Even DOMContentLoaded is not a drop in replacement.

1

u/ExtraWorldliness6916 2d ago

jQuery docs states that it serves a similar purpose, good enough for me