1

Possible Duplicate:
How to add a Facebook “Like” button to an AJAX driven page

I have a comics website (www.hittingtreeswithsticks.com), and I'm using window.history.pushState(null, null, '.?action=viewcomic&id=' + imgIndex); to update the URL id each time someone gets next or previous comic.

I'd also like to associate a comments/likes functionality with each individual comic so I can see how popular they are.

I've put the following fb likes and comments code (will soon change to DISQUS) on the view comic page:

<center>
<div class="fb-like" data-href="http://www.hittingtreeswithsticks.com/" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true" data-font="trebuchet ms"></div>         
<br />
<br />
<div class="fb-comments" data-href="http://www.hittingtreeswithsticks.com" data-num-posts="2" data-width="470"></div>
</center>

As of now, the likes are only associated with the entire site, and not specific comics... so if I go to the next comic, it's still the same like count (645) and comments.

enter image description here

What can I do to associate likes/comments, or anything else for that matter with specific comic IDs?

Thanks!

Community
  • 1
  • 1
user3871
  • 12,432
  • 33
  • 128
  • 268
  • @dev-null-dweller his solution suggests I should create a new like button each time a new id is loaded (each time URL changes). I have to do it that way? I thought there might be a smoother method of handling this seemingly rather common problem. – user3871 Dec 30 '12 at 20:02
  • @dev-null-dweller according to http://developers.facebook.com/docs/reference/plugins/like/?refid=28 it seems that I should be using "like connection", which displays likes for a certain object, rather than a like button, which displays all likes on the site. – user3871 Dec 30 '12 at 20:05
  • I don't see where the duplicate is? – user3871 Jan 03 '13 at 23:50

0 Answers0