How to pass a variable into a dialog function?
<p>How do i pass my rating variable  from updateRating() function into my window.location.replace(url + rating) which in the "proceed" function in my dialog? </p>

<p>Here are my codes:</p>

<pre><code>         &lt;script type="text/javascript"&gt;

        $(document).ready(function(){
            $(".hireraccept").click(function(){
                     $('.jRating').jRating();
                     $("#dialog-rate").dialog("open");
                     itervalue = $(this).attr("value");


                    return false

        });


        $("#dialog-rate").dialog({

            autoOpen: false,
            resizable: false,
            height: 200,
            width: 200,        
            modal: true,
            buttons: {
                "Proceed": function(){

                    window.location.replace("{{ domain_url }}/workroom/accept/" + itervalue +"/" + rating);
                    $(this).dialog("close");

                }

            }


        }); }); &lt;/script&gt;






  &lt;script&gt; 
  function updateRating(rate,proceed){
  goodtogo = proceed;

  rating = rate;

}  
&lt;/script&gt;    
</code></pre>
