Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Load Disqus comments on click
<button class="disqus-button">View comments</button>
<div id="disqus_thread"></div>
<script async="true">
var disqus_config = function () { = YOUR_PAGE_URL; = YOUR_PAGE_IDENTIFIER;
button = document.getElementsByClassName('disqus-button')[0],
loadDisqus = function(e) {
var d = document, s = d.createElement('script');
button.className = 'disqus-button--hidden';
s.src = '//';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
button.addEventListener('click', loadDisqus);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment