Title: js callback?
Last modified: February 21, 2019

---

# js callback?

 *  Resolved [imbeard](https://wordpress.org/support/users/imbeard/)
 * (@imbeard)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/)
 * Hi,
    first of all great plugin! I really like it so far.
 * I’m using it on a website where posts are loading with an infinite scroll system,
   next post is loaded during user scroll, is there a javascript function to reload
   the plugin on new post load?
 * thanks!
    Andrea

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Blaz K.](https://wordpress.org/support/users/blazk/)
 * (@blazk)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11232736)
 * Hi Andrea,
 * at the moment unfortunately not. There is a function load_results (see rate-my-
   post-public.js line 186) which populates the rating widget but it requires sum
   of ratings and vote count data. This data is retrieved from the server via ajax
   on page load (see line 33-43). Which plugin are you using for infinite scroll?
   I’m curious how it works 🙂
 * Blaz
 *  Thread Starter [imbeard](https://wordpress.org/support/users/imbeard/)
 * (@imbeard)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11232758)
 * Hi Blaz,
    thank you for your answer, I’m using this plugin [https://autoloadnextpost.com/](https://autoloadnextpost.com/)
 * but I modified it according to my needs, you can see it in action here : [https://www.baby-chick.com/woodland-theme-baby-shower/](https://www.baby-chick.com/woodland-theme-baby-shower/)
 * I’m including your plugin on a staging site but as you can imagine when I scroll
   to a new article the rating section is the same as the previous article. The 
   autoload plugin has a callback when a new post is loaded so I guess if there’s
   a way to re-call your load_results inside that callback
 * thanks!
    Andrea
 *  Thread Starter [imbeard](https://wordpress.org/support/users/imbeard/)
 * (@imbeard)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11232770)
 * Oh and actually I tweaked the css of your plugin to have a simply thumb up/thumb
   down look, so I don’t care about the count, I only use rating 1 and 2
 * 1: thumb down (give feedback)
    2: thumb up (i liked the article)
 *  Plugin Support [Blaz K.](https://wordpress.org/support/users/blazk/)
 * (@blazk)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11234682)
 * Hi Andrea,
    I checked the AutoLoad plugin and compatibility with Rate my Post.
   So, there are several problems.
 * 1. Rate my Post is designed to allow only one rating widget per post. AutoLoad
   plugin overrides this and thus prevents Rate my Post from working properly. This
   could be solved if AutoLoad plugin would allow to call a js function before a
   new post is loaded (you could remove current widget with jquery) but as I see
   that’s not the case.
 * 2. Rate my Post depends on wp_localize_script function from where it gets the
   post id. So, the output of the wp_localize_script function doesn’t change after
   new post is “auto loaded”. Therefore, even if we call the function to load results
   it will be always related to the first post and not to “auto loaded” posts.
 * To be honest I don’t see any quick and easy solution to ensure the compatibility
   with AutoLoad plugin. Nevertheless, I’ve put this on my list but I’m currently
   working on AMP, top rated posts widget etc. What you could do though, is to create
   a function that hides rate my post altogether when new post is loaded.
 * Blaz
 *  Thread Starter [imbeard](https://wordpress.org/support/users/imbeard/)
 * (@imbeard)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11234703)
 * Hi Blaz,
    thanks a lot for taking a look!
 * I’ve found a way around editing your plugin adding classes instead of ids on 
   results div and recalling your saving/checking functions on ALNP callback functions,
   this function passes the current loaded Post ID so I just had to replace your
   rmp_frontend.postID with the ID returned from the callback of ALNP.
 * Using or adding classes instead of IDs there (like #thank-you-msg) could be useful
   in these scenarios.
 * Everything seems to work right now,I have one last question, is there a way to
   reset stats?
 * thank you!
    Andrea
 *  Plugin Support [Blaz K.](https://wordpress.org/support/users/blazk/)
 * (@blazk)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11234988)
 * Hi Andrea,
 * good to hear that you managed to resolve the issues. Votes and feedback can be
   reset in meta box in edit post. If you want to reset all stats at once you can
   check “delete all plugin data on uninstall” in the options and then uninstall
   the plugin. However, since you modified the plugin make a backup first. This 
   option also removes all settings, customization and feedback.
 * Blaz
 *  Thread Starter [imbeard](https://wordpress.org/support/users/imbeard/)
 * (@imbeard)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11235699)
 * Ok thanks a lot!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘js callback?’ is closed to new replies.

 * ![](https://ps.w.org/rate-my-post/assets/icon-128x128.png?rev=2045796)
 * [Rate My Post - Star Rating Plugin by FeedbackWP](https://wordpress.org/plugins/rate-my-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rate-my-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rate-my-post/)
 * [Active Topics](https://wordpress.org/support/plugin/rate-my-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rate-my-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rate-my-post/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [imbeard](https://wordpress.org/support/users/imbeard/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/js-callback/#post-11235699)
 * Status: resolved