Michael Yousrieon Stack Overflow • Recommends
On “Render Jinja after jQuery AJAX request to Flask”
Okay, I got it.
Simply, I made an external html file and added the required jinja template to it.
{% for object in object_list %}
{{object.name}}
{% endfor %}
then in my Flask file I literally returned the render_template response to the jquery ( which contained the HTML I wanted to append )
objects_from_db = getAllObjects()
return jsonify({'data': render_template('the_temp.html', object_list=objects_from_db)}
And then simply append the HTML from the response to the required div to be updated.
Edit: Here's the link to a Youtube video that I made which explains the process:
link to this video