Subbing in Variables into Jquery
<p>I have the following jQuery script running on my page:</p>

<pre><code>&lt;script type="text/javascript" charset="utf-8" src="{{ STATIC_URL }}js/raty/js/jquery.raty.min.js"&gt;&lt;/script&gt;
&lt;script type ="text/javascript"&gt; 
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(),
        });
        });
    });
  &lt;/script&gt;
</code></pre>

<p>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 <code>var vote_url</code> to a direct path <code>"spice/rate/1/2"</code> and this indeed worked properly.</p>

<p>This leads to two questions:</p>

<ol>
<li>How can I debug it to see which URL is being used (ie. the variables being subbed in?)</li>
<li>How can I correct this problem?</li>
</ol>

<p>Here is the relevant snipped of code from the template:</p>

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