Skip to content
0:00 / 0:00

#flask#jquery#ajax

jQuery Ajax with Python/Flask | Remastered

/m1ke

67 subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

761 views3 years ago1 recommendation

Web developmentProgramming languagesPythonJavaScriptHTTP, REST and GraphQL

A tutorial demonstrating how to make AJAX requests from jQuery to a Flask backend and handle the response.

This is a remastered version of the previous video: youtube.com/watch?v=zJdQxS3ZpNI with a much better quality and explanation (hopefully) Feel free to comment if you have any questions or requests for new videos. Wanna buy me a coffee? buymeacoffee.com/m41kdevelops

Why it's here

1 person recommends this

What people say. Recommended for learning how to render Jinja templates and return them via jQuery AJAX requests in Flask.

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