Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

You can also set it in JS still a meta tag and image I guess though. It's how some sites do the notification badge thing that is animated.


sort by: page size:

Right, but you need to execute some JS to set them up, and the example only shows img tag.

It's on JavaScript.

There's a decent amount of JavaScript in there to enable it.

So instead of a very simple and straightforward html tag you propose a full js module and animations and so on?

And all this just to remove an important cue from the sight of your users?


So the site has to allow script tags for this to work? If that's the case, then you could simply put the code in the script tag and not have to mess around inserting it into a gif.

It’s a few lines of standard JavaScript. Nice touch used by many sites, not difficult.

There is Javascript...

This is brilliant. How do you use this though? I am not from JS background. A video tutorial on how to use this on my own website would be great.

This was done in the 90's. You simply refresh the page periodically. You can use the HTML "meta refresh" tag, no JS required.

Also 4) ability to see the text results of your request.

No way for JS to do that with an IMG tag, I don't think.


Assuming that works, I don't see the need for Javascript when a meta refresh achieves the same with just HTML.

Yes, but it's JS, it isn't vanilla HTML.

Really neat idea. I'm sad that the site requires JavaScript, but I don't know how this would work otherwise.

There is no need for JS on a site like this. The ajax upvote is convenient but they could (unconveniently) reload the whole page and set the location with an anchor to go back to the upvoted comment, 1994 style. Any real time notification system requires a backend infrastructure that maybe they don't want to have.

They could also use a better CSS but who cares, text is king in this kind of sites. It displays quite well on mobile too, especially with Opera which reflows text after zoom (the very reason for using Opera).


I might be wrong, but I think he meant that JS runs, a new http request is made, when you hover over the logo. (Which is close to the back button, so it seems like JS is running, when you hover over the back button.)

I cant tell because it requires JS to even render the text.

It uses JavaScript.

Personally I think this solution is simpler and easier to implement than using js. This isn't really an abuse. This seems exactly what these tags were intended for

This is awesome! I think I missed it but is there a link to the JavaScript in the article?
next

Legal | privacy