Problems with Disqus/Ajax
Tue, Jun 5, 2012 at 8:39 AM by Dave Winer.
  • Update: I punted on this method of doing it, instead going with a non-Ajax approach. I realized I was putting too much effort into functionality that wasn't that important. Happens often with easily-distracted geekoids. :-)
  • I'm trying to do something fancy with Disqus. Possibly too fancy. But the idea is very compelling. So I'm struggling to make it work.
    • I have a page with many items on it.
    • Each item has a discussion icon floating on the right margin.
    • When you mouseover the icon, three globals are set, including myId and myUrl.
    • A Bootstrap 2 modal dialog pops up and in its bind callback we call DISQUS.reset, with this.page.identifier and this.page.url set from myId and myUrl.
    • It works in a simple case with two threads.
    • It works in a more complex case with a bunch.
    • But now it fails to load unique threads on the new pages I start. Here's an example. It's just re-using the threads over and over. I'm fairly sure the IDs I'm sending are unique. I constructed the URLs without any idea to what they're supposed to do. The IDs seem like they should be enough. I don't want or need pages that display a discussion thread all on its own.
    • The help page doesn't say very much. It says that you have to have a hash-bang url. I tried that, and it didn't appear to make a difference. As I said, I don't understand what role the URL is playing here.
  • It's probably something I broke (I hope!) but I'm pulling out what's left of my hair trying to figure this out.
  • Be a Javascript hero today, and help me figure this out. I will be eternally grateful! :-)