Support » Plugin: WP-PostRatings » Uncaught ReferenceError: current_rating is not defined

Viewing 2 replies - 1 through 2 (of 2 total)
  • Make sure you have <?php wp_footer(); ?> before the </body> tag.

    Thank you, I couldn’t understand what you meant 😀

    In case somebody will come back here to check this problem, I will try to tell what happened.

    The javascript is loaded in the footer because it enqueues the script like this:

    wp_enqueue_script('wp-postratings', plugins_url('wp-postratings/postratings-js.js'), array('jquery'), '1.63', true);

    The last “true” argument indicates so.

    In order to be loaded in the footer, it needs a hook to grab… that hook is what atul1280 mentions, the “wp_footer()” hook.

    When that function executes, it runs everything what is hooked on it, in this case, the javascript code of the rating plugin.

    In my case, I didn’t have the piece of code…


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught ReferenceError: current_rating is not defined’ is closed to new replies.