How to set data in local HTML storage using Python?

I want to set data in local HTML storage using Python (I use flash framework). Do I need to use JavaScript?

+4
source share
1 answer

You need to use JavaScript.

Python (the server side) knows nothing about JavaScript (the client side), where the local storage is located.

The easiest, though not the most effective way to solve the problem is

  • You have a JavaScript JS fragment running on your HTML page

  • This JS makes a server side AJAX request. Try jQuery.getJSON ()

  • Viewing flags returns JSON data

  • JS code gets JSON and saves it in localStorage

, , (JavaScript) cookie.

+4

All Articles