title: How to use Flask's render_template from an ajax POST form submit
body: <p>I am hoping to get an answer to this <a href="https://stackoverflow.com/questions/22790980/ajax-post-returning-render-template-in-flask">similar question</a>:</p>
  
  <p>I have a jQuery form that sends JSON data to a certain URL that is served by Flask:</p>
  
  <pre><code>    &lt;div id="form"&gt;      
        &lt;form id="send"&gt;        
          &lt;input type="submit" value="Continue" &gt;
        &lt;/form&gt;
      &lt;/div&gt;
  
  
  
  jQuery(document).on('ready', function() {
          jQuery('form#send').bind('submit', function(event){
          event.preventDefault();
  
          var form = this;
          json = geojson.write(vectors.features);
  
          $.ajax({
              type: "POST",
              contentType: 'application/json',
              url: $SCRIPT_ROOT + "/create",
              dataType: "json",
              success: function(){},
              data: json
  
          });
      });
  });
  </code></pre>
  
  <p>On the Flask side, I have a simple function that renders an HTML page displaying the JSON object:</p>
  
  <pre><code>@app.route('/create', methods=['POST'])
  def create():
      content = request.json
      print content
      return render_template('string.html', string = content)
  </code></pre>
  
  <p>I know the JSON is being passed, because I can see it printed in the console running the Flask server:</p>
  
  <p><img src="https://i.stack.imgur.com/cJsK9.png" alt="console print"></p>
  
  <p><strong>The problem is that the template is rendered as part of the response of the Ajax request, but I want the template to be rendered as a new html page:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/GpR8p.png" alt="response of request"></p>