Get your very own Web 2.0™ increment button for your website!

What does it look like?
An example Web 2.0 increment button
(This is just a preview, I can't put an interactive one on cohost.)

How do I get one?
Just copy this HTML anywhere on your page (make sure to change "changeme" to some other thing):

<object
  data="//incr.easrng.net/badge?key=changeme&web=2.0"
  height="20"
></object>

What if I don't want Web 2.0™?
You can use an ordinary increment button! Ordinary increment buttons work in older browsers, don't require JavaScript, and are 88x31 so they fit right in with other buttons/badges.


You must log in to comment.

in reply to @easrng's post:

you can make a cohost increment button! use two server-rendered images, one "/count.png" and one "/increment.png" or something and when you send a request to "/increment.png", have it increment the counter and return the generated image. then on cohost, use details/summary tags to reveal the increment.png when you click the button. a bit complicated but it works

oh does your increment button support multiple increments? i did not consider that. there is a hack you can do nesting a bunch of details/summary tags to make it possible to click the button a few times until you run out of clicks but you will not be able to click it again after reloading

you can resize though i think, the server image can return a different size and i think you can use img tags on cohost

done! add &dec=rease to the end of the url. web 2.0 works too. it's a purely cosmetic change, if you have one decrement counter and one increment counter with the same key the number only ever goes up for the increment counter and down for the decrement counter, they don't fight. also idk if i documented this anywhere but you can add &bg=//your/url/here to set a custom 88x31 background

thanks but it doesn't work properly with scripts disabled

i'm also a big confused about the bg thing, why is it set in the url if the iframe comes with a style to set the background? there seems to be issues removing that too.

oh right i forgot to pass through the dec=rease like i do the bg. the iframe style is just for while it's loading, i try to support as many browsers for the 88x31 version as possible and not all of them do transparency iirc.

both the bg image and the iframe take time to load, and the only issue i see is that without scripts, the background disappears for a fraction of a second. i think it could be solved by using a second inner iframe for the number that reloads, while the main iframe just contains the background.

currently dec=rease isn't enough to get the button working properly because it will flash the increase background image if scripts are disabled (with the rest of the current embed link), and i don't think most web developers would notice this or the other issues that could come up with mismatched backgrounds, so i think the two iframes would be better