Stack Overflow Asked by Eric Cai on February 28, 2021
Here is the code for the app.py:
def index():
if request.method=='POST':
time=request.form.get("time")
return render_template("result.html", time=time)
else:
return render_template("mainpage.html")
I want to reference the time variable in my result.html code, here is what i did:
building = "https://data.calgary.ca/resource/c2es-76ed.geojson?issueddata=" + time
fetch(building)
.then(function(response) {
return response.json();
})
.then(function(data) {
L.geoJSON(data).addTo(mymap);
});
The url("https://data.calgary.ca/resource/c2es-76ed.geojson?issueddata=") plus the time variable would be a complete url for geoJSON. However, the code i wrote did nothing. Can someone help me please?
Nevermind, i just figure out i have to put "{{time}}" instead of time
Answered by Eric Cai on February 28, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP