Live data from Hacker News

Lemmings 404 page

romainbrasier.fr

21–30 of 78 posts

Re: Lemmings 404 page

#21

Earlier quoted context omitted.

$("img").mouseover()

Wait...jQuery is available?? double :(

Was this double :( a response to the fact that jQuery is available and shouldn't have needed to be? Or because you just wrote 6 lines of javascript when you could have written 1?

I read it as the first, and had this immediate reaction:

- I'd rather write the 1 line of jQuery over the 6 in vanilla javascript

- I'd rather read the 1 line of jQuery to understand what is going on instead of the 6 in vanilla javascript

- jQuery didn't actually impact your experience much... as you didn't realize it might even be available.

Re: Lemmings 404 page

#23

Earlier quoted context omitted.

window.setInterval(function() { $('img').mouseover(); }, 500); So you can catch the ones that haven't been created yet.

$('img').live('mouseover', function() {}); Same, but nicer, listens to mouseover events on img elements that may not exist yet. Then again, this will - if I understand correctly - cause the event to bubble up in the DOM until it reaches the root element, where jquery's live callback handler will check what element the event took place on and invoke that callback.

You're spot on that's the cleanest conceptual way to do it in jQuery. In more recent versions of jQuery, though, $.live is technically deprecated (1.7+). The equivalent new syntax is:

$(document).on('mouseover', 'img', function() {});

Re: Lemmings 404 page

#24

Earlier quoted context omitted.

window.setInterval(function() { $('img').mouseover(); }, 500); So you can catch the ones that haven't been created yet.

$('img').live('mouseover', function() {}); Same, but nicer, listens to mouseover events on img elements that may not exist yet. Then again, this will - if I understand correctly - cause the event to bubble up in the DOM until it reaches the root element, where jquery's live callback handler will check what element the event took place on and invoke that callback.

[deleted]

Re: Lemmings 404 page

#27

One of my favourite 404 pages was this: http://www.homestarrunner.com/systemisdown.html

That's not not a 404 page (missing page). It seems like it's supposed to be a 500 page (server error) or 503 page (unavailable) but it incorrectly returns a 200 status which means everything is OK.

Edit: Corrected the 50X error information thanks to the responses below.

Re: Lemmings 404 page

#28
It's much easier if you resize the tab - they all fall in a nice little column (and it doesn't change if you resize it after the load).

Re: Lemmings 404 page

#29

One of my favourite 404 pages was this: http://www.homestarrunner.com/systemisdown.html

That's not not a 404 page (missing page). It seems like it's supposed to be a 500 page (server error) or 503 page (unavailable) but it incorrectly returns a 200 status which means everything is OK. Edit: Corrected the 50X error information thanks to the responses below.

500 isn't server busy, it's server error.

Re: Lemmings 404 page

#30

Earlier quoted context omitted.

$('img').live('mouseover', function() {}); Same, but nicer, listens to mouseover events on img elements that may not exist yet. Then again, this will - if I understand correctly - cause the event to bubble up in the DOM until it reaches the root element, where jquery's live callback handler will check what element the event took place on and invoke that callback.

You're spot on that's the cleanest conceptual way to do it in jQuery. In more recent versions of jQuery, though, $.live is technically deprecated (1.7+). The equivalent new syntax is: $(document).on('mouseover', 'img', function() {});

the 5 previous posts in this thread are so perfectly stepwise, it's making my head explode.
Post reply on HN