title: Creating a dynamic popup for Disqus comments for different threads
body: <p>Edit: It seems Disqus is using the current page URL as the comment thread identifier despite me being explicit and stating:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var disqus_developer = 1;
      var disqus_identifier = "@Model.UniqueThreadIdentifier"; &lt;--- HERE
      var disqus_shortname = 'foo';
  
      /* * * DON'T EDIT BELOW THIS LINE * * */
      (function () {
          var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
          dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
          (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      })();
  &lt;/script&gt;
  </code></pre>
  
  <p>Read below for more details.</p>
  
  <hr>
  
  <p>Disqus says that I can identify a "page" with a unique identifier. </p>
  
  <p>Now in this particular page there are about 10 items and I'd like each item to have a personal Disqus discussion thread.</p>
  
  <p>So here's the actual page that gets loaded:</p>
  
  <pre><code>@foreach (var strong in Model.StrongAgainst)
  {
      &lt;div class="pick"&gt;        
              &lt;div class="actions"&gt;
                  &lt;a href="#modalDialogue" data-toggle="modal" 
                     id="@strong.UniqueThreadIdentifier" class="btn btn-comment"&gt;
                      &lt;i class="icon-comment"&gt;&lt;/i&gt;
                      999
                  &lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>That <code>@UniqueThreadIdentifier</code> is what I'm using to let Disqus load the appropriate thread.</p>
  
  <p>Next, in that same HTML view, I have this Javascript line, which using the UniqueIdentifier returns a PartialView with the appropriate Disqus configuration and HTML:</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
      $(document).ready(function () {
          $(document).on("click", "#strong-against .pick .data .actions .btn-comment", function () {
              var commentUniqueVar = $(this).attr("id");
              $.ajax({
                  url: '/Counterpicks/GetCommentThread',
                  data: { uniqueidentifier: commentUniqueVar },
                  success: function (data) {
                      $('#strongAgainstCommentModal').html(data);
                      alert("Finished loading.");
                  }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>And up to here it's 100% confirmed that the right values are being loaded into the HTML.</p>
  
  <p>Here is the PartialView:</p>
  
  <pre><code>&lt;div class="modal-body"&gt;    
      &lt;div id="disqus_thread"&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          var disqus_developer = 1;
          var disqus_identifier = "@Model.UniqueThreadIdentifier";
          var disqus_shortname = 'foobar';
  
          /* * * DON'T EDIT BELOW THIS LINE * * */
          (function () {
              var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
              dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
              (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
          })();
      &lt;/script&gt;
      &lt;noscript&gt;
          Please enable JavaScript to view the &lt;a href="http://disqus.com/?ref_noscript"&gt;comments
              powered by Disqus.&lt;/a&gt;&lt;/noscript&gt;
      &lt;a href="http://disqus.com" class="dsq-brlink"&gt;blog comments powered by &lt;span class="logo-disqus"&gt;
          Disqus&lt;/span&gt;&lt;/a&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p>Notice how I set the <code>disqus_identifier</code> using a strongly typed model with the correct value.</p>
  
  <p>My only guess is that when declaring a variable like that, it's created globally? (I think?) And the Disque javascript library is always going to use the first value I assigned to it. Correct?</p>
  
  <p>How can I appropriately load the correct identifier to the Disqus javascript library?</p>