title: how to send JSON to HTML file using flask?
body: <p>I'm at a beginner at coding and i'm stuck at the final closing :|
  i'm using python 2.7
  this is my <strong>serever.py</strong></p>
  <pre><code>from flask import Flask, render_template,request,jsonify
  import requests
  import json
  import new
  
  app = Flask(__name__)
  
  #serve homepage
  @app.route('/', methods=[&quot;GET&quot;,&quot;POST&quot;])
  def homepage():
     return render_template('page2.html')
   
  @app.route('/page3.html', methods=[&quot;POST&quot;])
  def result_matchup():
      h= request.form['h']
      a= request.form['a']
      l= request.form['l']
      p= request.form['p']
      result = json.dumps(new.calc(h,a,l,p))
      
      return render_template('page3.html',result=result)  
  
  
  if __name__ == &quot;__main__&quot;:
      app.run(debug=True)
  </code></pre>
  <p>when i ask for <code>return result</code> for checking myself, this is the output:</p>
  <pre><code>{&quot;f&quot;: 197.1, &quot;k&quot;: 196}
  </code></pre>
  <p>this is my page3.html:</p>
  <pre><code>
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;center&gt;&lt;h1&gt;Final = {{f}}&lt;/h1&gt;&lt;/center&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>the output for all this is
  <strong>&quot;Final = &quot;</strong>
  ,while I expect for <strong>Final = 197.1.</strong></p>
  <p>what am I doing wrong? any help?</p>
  <p>thanks!</p>