Live data from Hacker News

Lemmings 404 page

romainbrasier.fr

31–40 of 78 posts

Re: Lemmings 404 page

#31
post #29

Earlier quoted context omitted.

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.

I'd say being busy can be considered as an error.

503 (Unavailable) is more suitable for that I guess.

Re: Lemmings 404 page

#32
As much as I love the 404, even more so I adore the immediate response of the hacker news community to find the best way to save all the lemmings. Bravo!

Re: Lemmings 404 page

#36

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.

It is correct for a request for a page named "error" to result in a 200 OK status meaning that the page named "error" was successfully retrieved.

It would not be correct for a request for a page named "error" to return 404 Not Found if the page named "error" was retrieved successfully.

It would also not be correct for a request for a page that does not exist to return the page named "error" with a 200 OK status.

Re: Lemmings 404 page

#37
post #21

Earlier quoted context omitted.

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 -…

I'd take the 6 lines of vanilla javascript any day over loading the full jQuery library to get away with writing only a single line. If jQuery isn't use anywhere else on the page, that is.

Re: Lemmings 404 page

#38
post #17
post #6

best 404 page i've seen ! I ended up playing. Code is pretty neat. I thought you'd need more lines than this. http://www.romainbrasier.fr/js/lemmings.js

`this.img=eval($('.last'));` Why is he using eval here?

I have no clue, and it's bothering me.

MDN says: >> If the argument of eval() is not a string, eval() returns the argument unchanged.

I copied the code and tried it both ways, saw no apparent difference. I don't think it does anything.. I could be wrong...

Re: Lemmings 404 page

#39
post #31
post #29

Earlier quoted context omitted.

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

I'd say being busy can be considered as an error. 503 (Unavailable) is more suitable for that I guess.

Yeah, IIRC 5-8 years ago Apache used to return 500 when PHP scripts timed out... hence association with "busy."

Re: Lemmings 404 page

#40

Earlier quoted context omitted.

$("img").mouseover()

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

Looks like a use case for MutationObserver:

    var evt = document.createEvent("MouseEvent");
    evt.initMouseEvent("mouseover", true, true, window,
      0, 0, 0, 0, 0, false, false, false, false, 0, null);

    function isALemming(node) {
      return node.nodeName === 'IMG';
    }
    function fakeMouseover(node) {
      node.dispatchEvent(evt);
    }
    
    function saveLemmings(possibleLemmings) {
      possibleLemmings.filter(isALemming).forEach(fakeMouseover);
    }
    
    var observer = new MutationObserver(function(mutations) {
      mutations.forEach(function(record) {
        saveLemmings(Array.prototype.slice.call(record.addedNodes || []));
      });
    });
    saveLemmings(Array.prototype.slice.call(document.getElementsByTagName('img')));
    observer.observe(document.body, { childList: true });
Post reply on HN