I'm new to HTML/javascript. I'm running a local server, with an html/javascript file and a separate python script.
Question: How do I pass a python array to javascript variable?
Work so far:
I've written the array to file data.txt:
1 32.1
2 10.0
but I could put it in JSON format if it's easier.
Here's my progress so far:
var x_pos = [];
jQuery.get('http://127.0.0.1:8000/data/data.txt',function(data){
// ??? Code here ???
});
console.log(x_pos[0])
Note: if there is a much simpler way to do this, I'm open to suggestion. Thanks.