The Single Piece of JavaScript on HN
31–40 of 195 posts
Re: The Single Piece of JavaScript on HN
#32Re: The Single Piece of JavaScript on HN
#33Re: The Single Piece of JavaScript on HN
#34He exposed his auth id
Re: The Single Piece of JavaScript on HN
#35Earlier quoted context omitted.
Well there appear to be two things stopping this: - Hiding two elements on the page (one can be hidden with the CSS :visited selector) - Remaining with your position on the page whilst also sending a message to the server and without opening new windows. So the only way to do the task is to send a full request to the server which would return you to the page with the buttons correctly disabled. Extra load on the serv…
You could render the vote buttons in iframes, so just the iframe would reload. But you'd have to load N iframes for N vote buttons on page load. Not worth the performance hit.
Re: The Single Piece of JavaScript on HN
#36Earlier quoted context omitted.
What's most fascinating to me about this isn't the simplicity, it's that this code has lived for so long with almost no changes. It's a great counter-example to all the recent articles about JavaScript fatigue. It's good for us to see real examples of sites that aren't caught up in the framework of the week hype. At the end of the day we're trying to make stuff that works. ES5 vs ES6, React vs Angular vs. Ember vs. A…
For the majority of cases that I've seen, these arguments are simply excuses to avoid doing real work. It's way more fun to decide whether your amazingly awesome Unicorn startup is going to use React or Angular, or Express vs. Rails, or whatever than it is to actually go through the hard work of building a customer base and making money.
For a subset of us, framework authors, open source contributors, etc. It's very useful to keep up to date on the latest trends.
For example, the Angular team has borrowed techniques from React. It helps for them to keep up with things.
For people like me though, let's be honest. I don't need to do the latest thing.
Re: The Single Piece of JavaScript on HN
#37Seeing the "auth" query. There is a chance that HN was "too clever" about it, and it might be possible to use other users id to upvote, or upvote many times, if you can figure out the hash algorithm.
Re: The Single Piece of JavaScript on HN
#38Re: The Single Piece of JavaScript on HN
#39If we ever make it around to a second piece of javascript on here, can I request that it be a collapse comment function? I promise i won't ask for anything else.
Re: The Single Piece of JavaScript on HN
#40So without JS enabled you can't vote?