Timeline for answer to Sending data from a python dictionary to a javascript file by Nepho
Current License: CC BY-SA 3.0
Post Revisions
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 6, 2017 at 14:56 | vote | accept | Community Bot | ||
| Dec 6, 2017 at 14:53 | comment | added | Nepho | Well, it depends. If you want to load that data statically (i.e., load it once whenever someone loads the page), you can probably put it directly in your html page. You can also store it in a database and have javascript in the page load it. To be honest the format/way of storing it doesn't matter much. | |
| Dec 6, 2017 at 14:51 | comment | added | user9040628 | Ah ok that makes sense. Does the file it is written in matter? Like should it been done in my html page or the python database etc.? | |
| Dec 6, 2017 at 14:47 | comment | added | Nepho | Unless you're running a javascript back-end (for example, Node.js), you will have a hard time getting the content of a file. You could probably use websockets for communication between the back-end and the website's front-end. | |
| Dec 6, 2017 at 14:45 | comment | added | user9040628 | Thank you, so I use this in my python file but how do I retrieve that data in my javascript file? | |
| Dec 6, 2017 at 14:42 | history | answered | Nepho | CC BY-SA 3.0 |