title: Flaskr url_for with parameters not working when called from javascript to python
body: <p>I am in the middle of creation of a web application. </p>
  
  <p>In javascript, I make a ajax call to my python script, process and send the result back as response.
  /process/ is the route to the python script for the processing of values which are sent as json, namely value1 and value2. I send back response as json setting value in key 'result'. </p>
  
  <p>In the success block of ajax, the value is stored in name_value and this should be passed as parameter to the python routing method. </p>
  
  <p>Javascript:</p>
  
  <pre><code>$.ajax({
          type: "GET",
          url: "/process/",
          contentType: "application/json; charset=utf-8",
          data: { "value1" : value1,
                  "value2" : value2
                 },
          success: function(data) {
              var name = data.result;
              console.log(name);
              window.location.href = "{{url_for('/process2', name=name)}}"
          }
      });
  </code></pre>
  
  <p>Python script:</p>
  
  <pre><code>app.route("/process2/&lt;name&gt;")
  def process2(name):
      print name
      render_template("user.html", name=name);
  </code></pre>
  
  <p>I am not receiving the parameter value in this case if parameter is passed in url_for. If I hardcode the parameter, I am able to receive the parameter value in the python script as in,</p>
  
  <pre><code>window.location.href = "{{url_for('/process2', name='helloworld')}}"
  </code></pre>
  
  <p>Any help is appreciated. Thanks in advance.</p>