Simple Bitcoin Donate Button

The problem: I was unable to find an easy solution which does not require complex scripts for adding a “Donate Bitcoins” button to my website. Most Websites just display the full Bitcoin address, which is large and ugly. So I tried to create my own.

The solution idea: I wanted to create a Button which allows the user to copy the Bitcoin address to the clipboard so I don’t have to display it on my website. Stackoverflow showed a nice idea: Display a prompt which allows the user to copy the address himself. Standard JavaScript function supported by most browsers. Does not require any libraries. This is also the most reliable solution since directly writing to the clipboard with JavaScript is not allowed by many browsers. There are libraries to allow scripts to write to the clipboard it but they commonly use Flash, which is overkill IMHO.

(TLDR) The solution – don’t forget to replace my Bitcoin address with yours:

<a href="javascript:void(0);" onclick="javascript:window.prompt ('Please copy-paste my Bitcoin address to your Bitcoin software - I cannot do it automatically.\nTo copy it, right-click the selected text and select \'Copy\'.\nThen right-click the address field in your Bitcoin software and select \'Paste\'.', '18bkQoBGCZwwP1JhkbAqifEQHyq2cYVv6v');">
<img src="http://www.ecogex.com/bitcoin/pack/ribbonDonateBitcoin.svg" width="104" height="26" alt="Donate Bitcoin" />
</a>

What it looks like – use this to donate some coins for me while you’re at it ;)
Donate Bitcoin

Additional information: The image – which I found here under the Free Art License – is a SVG so you can specify any size you want, it will scale cleanly.

GD Star Rating
a WordPress rating system
Simple Bitcoin Donate Button, 100% based on 3 ratings

6 thoughts on “Simple Bitcoin Donate Button

    • Does the standard Bitcoin client actually implement this yet?

      GD Star Rating
      a WordPress rating system
      • Bitcoin-Qt for Windows, Multibit and Electrum all support it. Bitcoin-Qt for Mac and Linux not yet. (I have read that on a Bitcoin Stack Exchange page)

        Sorry I have addicently posted this 2 other times at the wrong place due to a stupid weird bug in wordpress :( It’s not my fault sorry :(

        GD Star Rating
        a WordPress rating system
  1. Nice work. This is probably the simplest solution until the Bitcoin URI is in more common use.

    GD Star Rating
    a WordPress rating system
  2. Lieber Leo,
    mit gro├čen Interesse habe ich Ihren Informativen Internetauftritt verfolgt und finde Ihn sehr gelungen.

    Weiter so….

    In Liebe…..

    Ein treuer Fan *zwinker*’

    GD Star Rating
    a WordPress rating system

Comments are closed.