I'm a newbie in web development. In fact I knew nothing about it one week ago. Now I have a project on it assigned by senior colleagues.
The data is obtained using python, and the bridge from python to javascript is Flask, in main.py
. In reality the data
is much longer and returned by other function, but with format jsonify()
@app.route("/")
def home():
# JSON
data = '{ "name":"John", "age":30, "city":"New York"}'
response = render_template('home.html', data=data)
My question is how to access this JSON data
in a JS file like handle_data.js
? I want to make a highchart from this data into my home.html
Django Template Variables and Javascript this one doesn't work for me.