[FIX] nodes[i].parentNode.href is undefined
-
Disqus is isn’t checking to see if the parent node has an href attribute before it tries to utilize it. To correct this issue, open /wp-content/plugins/disqus-comment-system/media/js/count.js. The code should read as follows.
var disqus_shortname = countVars.disqusShortname; (function () { var nodes = document.getElementsByTagName('span'); for (var i = 0, url; i < nodes.length; i++) { if (nodes[i].className.indexOf('dsq-postid') != -1) { nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('data-dsqidentifier')); if (nodes[i].parentNode.href) { url = nodes[i].parentNode.href.split('#', 1); if (url.length == 1) { url = url[0]; } else { url = url[1]; } nodes[i].parentNode.href = url + '#disqus_thread'; } } } var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }());
Disqus plugin team: Please fix this, for it is broken. ?? This issue has gone unresolved for almost a year now.
- The topic ‘[FIX] nodes[i].parentNode.href is undefined’ is closed to new replies.