Support » Fixing WordPress » Disqus, Javascript, iPhone display error

  • simr



    I’ve just installed Disqus, it works fine except it interfered with the post ticker on the front page and displayed an error message relating to this part of the code:

    <script type="text/javascript">
        // <![CDATA[
            var disqus_shortname = '<?php echo strtolower(get_option('disqus_forum_url')); ?>';
            var disqus_domain = '<?php echo DISQUS_DOMAIN; ?>';
            (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('rel'));
                        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 = 'http://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';
                (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);

    I fixed it by ticking the option to output the Javascript in the footer. All good. But now when I browse the said on my iPhone, the post ticker has stopped functioning. There’s no error message, it just doesn’t display correctly.

    Any ideas? I’m not sure if this is a Safari-related issue but I’d imagine it’s not.

Viewing 1 replies (of 1 total)
  • I’m having the same problem, it’s a Disqus issue. Did you ever get this figured out? There’s a supposedly an option to load the script in the footer but I can’t find it.

Viewing 1 replies (of 1 total)
  • The topic ‘Disqus, Javascript, iPhone display error’ is closed to new replies.