title: Flask with Fetch API and render_template - receive new rendered data
body: <p>In my <code>Flask</code> project from input field I'm getting with <code>JS Fetch API</code> typed value by user and then I'm passing it to my Python function, where depending on user input I do different things. </p>
  
  <p>Everything work correctly. JavaScript getting value, Flask sees it.</p>
  
  <p>JS Code:</p>
  
  <pre><code>document.getElementById("search").addEventListener("click", function() {
      let token = new FormData();
      token.append('search', document.getElementById('search_place').value);
      const request = async() =&gt; {
          const response = await fetch('/stop', {
              method: 'POST',
              body: token,
              headers: {
                  'Access-Control-Allow-Origin': '*'
              },
              mode: 'cors'
          }).then((tables) =&gt; {
              $('.table').html(tables);
          });
      };
      request();
  });
  </code></pre>
  
  <p>With Flask every user input I want to change content in templates: </p>
  
  <pre><code>return render_template('view.html', tables=[pd.DataFrame.to_html(df, index=False, justify='justify-all')])
  </code></pre>
  
  <p>So user give new value then after 'Refresh' button click everything should be new inside templates. </p>
  
  <p><strong>I don't know how I should receive with Fetch API response from Flask, with new rendered data.</strong> </p>
  
  <p>I'm trying with: </p>
  
  <pre><code>.then((tables) =&gt; {
              $('.table').html(tables);
          });
  </code></pre>
  
  <p>without any success. </p>
  
  <p>Thanks in advance!</p>