title: Javascript passing variable from function to function
body: <p>How do i pass <strong>var rating</strong> and <strong>var itervalue</strong> into my window.location.replace? i get new rating variable from function updateRating() and when i click hireraccept, it assigns a new itervalue variable which i wish to pass them both into the "proceed" button into the window.location.replace url. any idea? </p>
  
  <pre><code>   &lt;script type="text/javascript"&gt;
     $(document).ready(function(){
     var rating =  0;
     var itervalue = 0;
  
     $(".hireraccept").click(function(){
                  $('.jRating').jRating();
                  $("#dialog-rate").dialog("open");
                  var 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 type="text/javascript"&gt; 
        function updateRating(rate,proceed){
        goodtogo = proceed;
  
        rating = rate;
  
  } 
      &lt;/script&gt;
  </code></pre>