Advertisement
Guest User

Untitled

a guest
Sep 26th, 2012
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.51 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
  4. </head>
  5. <body>
  6.  
  7. <script type="text/javascript">
  8.     var disqus_shortname = 'elopakao';
  9.     var disqus_identifier; //made of post id and guid
  10.  
  11.     function loadDisqus(source, identifier) {
  12.  
  13.         if (window.DISQUS) {
  14.  
  15.            $('#disqus_thread').insertAfter(source); //append the HTML after the link
  16.  
  17.            //if Disqus exists, call it's reset method with new parameters
  18.            DISQUS.reset({
  19.               reload: true,
  20.               config: function () {
  21.               this.page.identifier = identifier;
  22.               }
  23.            });
  24.  
  25.         } else {
  26.  
  27.            //insert a wrapper in HTML after the relevant "show comments" link
  28.            jQuery('<div id="disqus_thread"></div>').insertAfter(source);
  29.            disqus_identifier = identifier; //set the identifier argument
  30.  
  31.            //append the Disqus embed script to HTML
  32.            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  33.            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  34.            $('head').append(dsq);
  35.  
  36.         }
  37.     };
  38. </script>
  39.  
  40.  
  41. <div class="this-is-single-post-wrapper">
  42.  
  43.    <!-- this part will likely contain individual post data -->
  44.  
  45.    <a onclick="loadDisqus($(this), 'luka');">
  46.       Show comments
  47.    </a>
  48. </div>
  49.  
  50. <div class="this-is-single-post-wrapper">
  51.  
  52.    <!-- this part will likely contain individual post data -->
  53.  
  54.    <a onclick="loadDisqus($(this), 'jakoduginizznakova2');">
  55.       Show comments
  56.    </a>
  57. </div>
  58.  
  59.  </body>
  60.  </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement