3

1. Summary

I would like to add a «Donate» Bitcoin button on my README.md file located on my GitHub repository.


2. Not helped

2.1. Manually button

HTML-code using bitcoin protocol:

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037"><img src="https://www.drupal.org/files/project-images/bitcoindonate.png" alt="Bitcoin Donate Button"></a>

It's work on HTML page of my GitHub Pages site, demonstration.

But in .md GitHub files not one codes of Meta Stack Exchange answer not work for bitcoin protocol, demonstration.

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037"><img src="https://www.drupal.org/files/project-images/bitcoindonate.png" alt="Bitcoin Donate Button"></a>

[**![Bitcoin Donate Button**](https://www.drupal.org/files/project-images/bitcoindonate.png)](bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037)

<a href="bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037">![Bitcoin Donate Button](https://www.drupal.org/files/project-images/bitcoindonate.png)</a>

2.2. Third-party

JavaScript not supported on GitHub README.md pages. By this reason doesn't help me:

3

1. Demonstration

Donate button

Click to donate button on page:

https://github.com/KristinitaTest/KristinitaTest.github.io/blob/master/donate/README.md

Link must be opened in your Bitcoin client, example:

Electrum


2. Relevance

This answer is relevant for April 2018. In the future, the data of this answer may be obsolete.


3. Redirect

You need to use redirect.

User click on Donate button → is redirected to Bitcoin-Redirect page in current tab → then opened bitcoin wallet of user → in current tab is opened page, on which Donate button is situated.


4. Details

4.1. Source of Donate button

[![Bitcoin Donate Button](https://i.stack.imgur.com/MnQ6V.png)](http://KristinitaTest.github.io/donate/Bitcoin-Redirect)

If you click the image, you will go to a page http://KristinitaTest.github.io/donate/Bitcoin-Redirect. See answer on Meta Stack Exchange, how use Markdown markup for this construction. Alternative worked HTML source:

<a href="http://KristinitaTest.github.io/donate/Bitcoin-Redirect"><img src="https://i.stack.imgur.com/MnQ6V.png"></a>

4.2. Source of Bitcoin-Redirect page

<script>
window.location.href = "bitcoin:17uctxtsWG3gpyAy6iJ8AVd5rdSjkJH2?label=In%20the%20treatme0of%20Sasha's%20teeth&amp;amount=0.0037";
history.back();
</script>

Use JavaScript methods window.location.href and history.back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.