Live data from Hacker News

Faster than jQuery(document).ready() - Wait Until Exists

javascriptisawesome.blogspot.com

31–40 of 48 posts

Re: Faster than jQuery(document).ready() - Wait Until Exists

#31
post #29

Earlier quoted context omitted.

If people saw [ 528 ] as the vote count for that comment, they'd be less likely to upvote it themselves.

That would be a bug, not a feature. If you see a comment or article you approve of, you should upvote it, regardless of how popular (or not) it is among other people. If there are 529 people who approve of a certain comment, then it comes by those 529 upvotes honestly.

This is the reason why some beggars on the street make more money than a full time job (If they're in a really good spot).

Everyone thinks they're just giving them a little bit. But all those little bits add up to a lot. Without any visibility into how much other people have already given them, there is no way for people decide if they really need the money or not.

If you saw a beggar on the street, and knew that they'd already been given $1000 so far that day, would you still give them a dollar?

Re: Faster than jQuery(document).ready() - Wait Until Exists

#32
post #29

Earlier quoted context omitted.

That would be a bug, not a feature. If you see a comment or article you approve of, you should upvote it, regardless of how popular (or not) it is among other people. If there are 529 people who approve of a certain comment, then it comes by those 529 upvotes honestly.

This is the reason why some beggars on the street make more money than a full time job (If they're in a really good spot). Everyone thinks they're just giving them a little bit. But all those little bits add up to a lot. Without any visibility into how much other people have already given them, there is no way for people decide if they really need the money or not. If you saw a beggar on the street, and knew that the…

I don’t see upvoting as giving something to a beggar; I see it as an exchange of value. You give me something I like (something interesting to read) and I give you something you like (karma).

Re: Faster than jQuery(document).ready() - Wait Until Exists

#34
post #29

Earlier quoted context omitted.

If people saw [ 528 ] as the vote count for that comment, they'd be less likely to upvote it themselves.

That would be a bug, not a feature. If you see a comment or article you approve of, you should upvote it, regardless of how popular (or not) it is among other people. If there are 529 people who approve of a certain comment, then it comes by those 529 upvotes honestly.

There are comments that I feel deserve 5-10 votes, but not 100.

Re: Faster than jQuery(document).ready() - Wait Until Exists

#35
post #25

Earlier quoted context omitted.

Still doesn't answer the question: how much earlier is it executed? I would like to know.

actually, the script doesn't make any sense because it would be executed as soon as the browser is idling, that is after it has rendered the dom completely, that is when the DOMContentLoaded event fires. The right way to run a script right after an element has been created is to place the script right after the element closing tag. You still can use it for setting late binding event handlers though.

It's using DOMNodeInserted (when available), which does fire as each element is created.

Re: Faster than jQuery(document).ready() - Wait Until Exists

#36

Earlier quoted context omitted.

I'm all for bringing back vote counts, I do sorely miss them... but I have to ask, in this particular case, how would mankind be served if we knew that 127 more people agree with cstuder? Maybe I'm missing something, this is an honest question.

If people saw [ 528 ] as the vote count for that comment, they'd be less likely to upvote it themselves.

I've also heard the exact opposite argued: that there's a pile-on effect when someone sees how the majority of the community thinks.

Re: Faster than jQuery(document).ready() - Wait Until Exists

#37
post #4

You know how you can accelerate your page even further? Don't use 1.49mb large GIF animations as background images...

I was wondering what caused my cpu fan to spin up then I noticed the page background.

co;dr = cpu overheated; didn't read

Re: Faster than jQuery(document).ready() - Wait Until Exists

#39

Something like this should be built-in in jQuery. You can do $(document).ready(), why not, the admittedly syntax sugared, $("div#main").ready().

I created a plugin for this type of thing a while back too:

http://plugins.jquery.com/project/available

Re: Faster than jQuery(document).ready() - Wait Until Exists

#40
post #13
post #4

You know how you can accelerate your page even further? Don't use 1.49mb large GIF animations as background images...

this is why we need vote counts to be displayed again.

I am the OP; i just removed the background... but is going to be back! (as soon as i figure out a way to make it consume less CPU... probably using canvas)
Post reply on HN