I have a web page that is written in HTML, and the actions are completed using JQuery. The html code below doesn't use any of the JQuery, but I figured I'd mention that since I may need to put some AJAX in there.
Here is the "front end"
index.html
<!DOCTYPE html>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="javaScript.js"></script>
<html>
<div id="liveOutputTitle">
<h1><span>Live Output</span></title>
</div>
<div id="liveOutput">
Value 1 From Python: <input type="text" name="Value1" id="Value1" value="0"><br>
Value 2 From Python: <input type="text" name="Value2" id="Value2" value="0"><br>
Value 3 From Python: <input type="text" name="Value3" id="Value3" value="0"><br>
</div>
I have a JQuery file, that doesn't affect anything that i've put in the html file. But here's a reference to that file.
jquery.js
$(document).ready(function(){
//logic for other functionality of the site
//I'm assuming some AJAX goes here
});
My end goal is to have a python program that pulls values from somewhere, and I'd like to have those values shown in the input fields.
My python "server side" code. does something like below:
serverSide.py
#!/usr/bin/env python
def getValueOne():
//gets the value from wherever
valueOne = 1
def getValueTwo():
//gets the value from wherever
valueTwo = 2
def getValueThree():
//gets the value from wherever
valueThree = 3
How do I get the values here, in the python, to show as these values change, to the respective input values in the HTML?
I've tried figuring that out using some tutorials on AJAX, but I haven't managed to get the logic completely together. I've read through this, this, and this, but I'm still not exactly sure how to connect this logic. Any help is appreciated.
EDIT 1
I'm sure someone will say that I should have mentioned what frame work I want to use (assuming you have to use a framework). I'm not sure, but I've read a lot about flask, and if I had to randomly choose one, I would use flask.