Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:16:38+00:00 2026-06-13T17:16:38+00:00

I have the following jQuery script running on my page: <script type=text/javascript charset=utf-8 src={{

  • 0

I have the following jQuery script running on my page:

<script type="text/javascript" charset="utf-8" src="{{ STATIC_URL }}js/raty/js/jquery.raty.min.js"></script>
<script type ="text/javascript"> 
jQuery(document).ready(function($) {
         $('.yourrating').each(function(index){
          $(this).raty({
            readOnly:  false,
            path: "{{ STATIC_URL }}js/raty/img/",
score: $(this).children("span:first").text(),
            click: function(score, evt) {
                var vote_url = "/spice/rate/" + this.attr('id').substring(2) + "/" + score + "/";
                $.ajax({
                  url: vote_url,
                  success: function(){
                  alert('vote successful');
                  }
                });
            }
          });
        $('.thingrating').raty({
          readOnly:  true,
          start:     2,
         path: "{{ STATIC_URL }}js/raty/img/",
score: $(this).children("span:first").text(),
        });
        });
    });
  </script>

Right now, when the user clicks it’s not recognizing the action and showing the pop-up, which tells me the variables are not being subbed in correctly. To confirm this, I changed var vote_url to a direct path "spice/rate/1/2" and this indeed worked properly.

This leads to two questions:

  1. How can I debug it to see which URL is being used (ie. the variables being subbed in?)
  2. How can I correct this problem?

Here is the relevant snipped of code from the template:

<div class="yourrating" id="t_{{ item.id }}"><span style="display:none;">{{score}}</span></div>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:16:40+00:00Added an answer on June 13, 2026 at 5:16 pm

    Why don’t I clean that up a bit for you, and give you an answer to accept!

    <script type ="text/javascript"> 
    (function($) {
        $(function() {
            $('.yourrating').each(function(index,elem){
                $(elem).raty({
                    readOnly:  false,
                    path: "{{ STATIC_URL }}js/raty/img/",
                    score: $(elem).children("span:first").text(),
                    click: function(score, evt) {
                        var vote_url = "/spice/rate/" + this.id.substring(2) + "/" + score + "/";
                        $.ajax({
                            url: vote_url,
                            success: function(){
                                alert('vote successful');
                            }
                        });
                    }
                });
                $('.thingrating').raty({
                    readOnly: true,
                    start: 2,
                    path: "{{ STATIC_URL }}js/raty/img/",
                    score: $(elem).children("span:first").text(),
                });
            });
        });
    })(jQuery);
    </script>​​​​​​​​​​​​​​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html/javascript stuff <html> <script type=text/javascript src=jquery-1.7.1.min.js></script> <script type=text/javascript> $(document).mouseup(function(event) {
I have following jQuery/JS code <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js></script> <script> $.getJSON(http://example/topics, {}, function(data){ console.log( data
I have the following Javascript libraries loaded for my page. <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
I have HTML which includes scripts in following order <script src=../static/js/jquery.js type=text/javascript> <script src=../static/js/bootstrap.js
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following jQuery <script type=text/javascript> jQuery(function(){ jQuery('.link1').click(function(){ jQuery('.hide-div').hide(); jQuery('.toggle1').show(); jQuery('#arrow').css({top: '0px'}); });
I have the following KnockoutJS template (render with jquery.tmpl): <script id=contactsTemplate type=text/html> <li data-bind=click:
I have the following Jquery running in an aspx page without the use of
I am running rails 3.1 and have the following jquery script in a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.