tapquo / Lungo.js

A framework for developers who want to design, build and share cross device applications.
http://lungo.tapquo.com
Other
2.41k stars 567 forks source link

Using Disqus as comment system #320

Open refda opened 10 years ago

refda commented 10 years ago

Thanks for your great mobile framework!

I load sections via php (ajax for example details.php?id=45). In these sections I would like to display Disqus comments. But it doesn't work.

How could I use the trigger (onload) dynamic for loading sections?


<section id="section<?php echo $id; ?>" data-transition="slide">
    <header data-title="<?php echo $title; ?>" data-back="chevron-left">
    </header>

    <article id="details<?php echo $id; ?>" class="list scroll indented">
<ul>
<li>
<img src="<?php echo $image; ?>">
</li>
<li>

<div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = 'example';
        var disqus_identifier = 'id1';
        var disqus_url = 'http://www.example.com';

        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>

</li>
</ul>   
    </article>

</section>