-
-
Save sgraber/864968 to your computer and use it in GitHub Desktop.
Disqus Comments Reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- You'll need to call get_disqus_num_replies() every time you alter the content (ex - ajax) --> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
var get_disqus_num_replies = function() { | |
var links = document.getElementsByTagName('a'); | |
var query = '?'; | |
for(var i = 0; i < links.length; i++) { | |
if(links[i].href.indexOf('#disqus_thread') >= 0) { | |
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&'; | |
} | |
} | |
var s = document.createElement('script'); | |
s.type='text/javascript'; | |
s.src = 'http://marcador.disqus.com/get_num_replies.js' + query; | |
var body = document.getElementsByTagName('body')[0]; | |
body.appendChild(s); | |
}; | |
get_disqus_num_replies(); | |
//]]> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment