Skip to content
Permalink
Browse files

use script[async+defer] in readme

  • Loading branch information
igrigorik committed Sep 1, 2014
1 parent 2458350 commit e41ee3e3741e96391b83f195a020a7027749462d
Showing with 4 additions and 10 deletions.
  1. +4 −10 README.md
@@ -19,22 +19,16 @@ Async, embeddable submit + vote counter button for Hacker News.
<a href="http://news.ycombinator.com/submit" class="hn-share-button" data-title="Some Title" data-url="http://www.igvita.com/">Vote on HN</a>
```

**Step 2**, add the following loader snippet right before the `</body>` tag:
**Step 2**, include the (async) javascript file:

```html
<script>
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = '//hnbutton.appspot.com/static/hn.min.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));
</script>
<script src="//hnbutton.appspot.com/static/hn.min.js" async defer></script>
```

_Note: you can safely embed multiple buttons on the same page._

### Misc

* Kudos to @sbashyal and @stbullard for the button styling (hnlike.com)
* (MIT License) - Copyright (c) 2012 Ilya Grigorik
* Kudos to Algolia for an [awesome HN API](http://hn.algolia.com/)
* (MIT License) - Copyright (c) 2012 Ilya Grigorik

0 comments on commit e41ee3e

Please sign in to comment.
You can’t perform that action at this time.