WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
[resolved] Uncaught ReferenceError: current_rating is not defined (3 posts)

  1. miguelsaddress
    Member
    Posted 1 year ago #

    Hello, the stars display right and nicely but it does not work.

    when i make a mouseover action, i get this in firebug:

    Uncaught ReferenceError: current_rating is not defined
    onmouseover

    Uncaught ReferenceError: ratings_off is not defined
    onmouseout

    has anyone passed through this? how can i solve it?

    thank you

    http://wordpress.org/extend/plugins/wp-postratings/

  2. atul1280
    Member
    Posted 1 year ago #

    Make sure you have <?php wp_footer(); ?> before the </body> tag.

  3. miguelsaddress
    Member
    Posted 1 year ago #

    Thank you, I couldn't understand what you meant :-D

    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...

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags