How does ajax work with python?

Usually, ajax handler on your server should return XML or JSON (I think JSON is better) with the data it needs.

So, after getting info from the handler, dump(cast) it into a JSON object and return to client.

On client, JavaScript receives this JSON, and after that should dynamically create html elements and insert them in your page body.

Start by exploring this simple tutorial by Flask’s creator.

Leave a Comment