WordPress.org

Support

Support » Plugins and Hacks » BuddyPress Like » Multiple instances of ajax call triggered

Multiple instances of ajax call triggered

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author darrenmeehan

    @darrenmeehan

    I’ll be removing bits of this code so I don’t think this is too much of an issue. I couldn’t figure out some of the problems with the ajax, so thanks a million!

    Plugin Author darrenmeehan

    @darrenmeehan

    I’ve reworked a lot of the jQuery code, will have it out in next update. I haven’t uploaded it yet as I don’t want people installing a totally broken plugin!

    Thanks!

    Quick question. What’s the reason for removing “view likes”? I’m still testing so I don’t have a post that has more than a few likes, but what if there are 100s of likes (or even 25 for that matter)? Listing all of them by default is going to take up a ton of real-estate. Are you only listing a certain number of them and adding a ‘view more’ or something?

    Plugin Author darrenmeehan

    @darrenmeehan

    The way I plan on building it is to show the last two or three people to like something, and then showing the number of others. Like so: “darrenmeehan, colabsadmin and 6 others liked this.” With “6 others” being a link to display everyone who liked the post probably in a small pop up.

    It’s a lot like how Facebook does it, though I think it makes sense for BuddyPress too.

    Excellent. Thanks

    Plugin Author darrenmeehan

    @darrenmeehan

    Oh and I forgot to mention I’m planning for it to be the last two people to like a post, so it’s always showing new people. Having the same people show up even after 100 likes would be pointless!

    If anyone has suggestions on this it would be great.

    That sounds perfect. I found some issues with it at the moment, but since you’re working on it, I’ve held of reporting it until the update comes out. Thanks again!

    Plugin Author darrenmeehan

    @darrenmeehan

    I’ve the update out not, but please post away at any issues you find!

    The new code is spawning a bunch of ajax calls again. It doubles the call with every click. First click makes two calls. The second click makes 4 calls. The third click makes 8 calls.

    Okay. I removed the jQuery(document).ajaxComplete(bp_like); line of code in bp-like-min.js and it has resolved the issue. But I’m not sure if it breaks anything else. Here are before and after screen shots of firebug. Note that I click 3 different like/unlike buttons. You can see all the requests is spawned (i was also printing out the button class and id to the console so I could see what was going on.)

    before change
    https://24.media.tumblr.com/058423aaaf0131e0408c1bb148ec1bc4/tumblr_n29zi8DRvb1squolvo1_1280.jpg

    after change (i actually clicked 5 buttons on this one)
    https://31.media.tumblr.com/275032f3934524a2ab53cf6fc90f44ba/tumblr_n29zi8DRvb1squolvo2_1280.jpg

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Multiple instances of ajax call triggered’ is closed to new replies.
Skip to toolbar