Answer the question
In order to leave comments, you need to log in
How to make ajax request in jqwery?
Hello.
I can't figure out how to make a primitive request to flask from a web page.
There is a button and plain text. It is necessary to dynamically access a variable without reloading the page, which contains a new value each time it is accessed.
Please show an example of how to do this primitively on jqwery.
<div class="container">
<p class="lead" > {{hook}} </p>
button type="button" class="btn btn-outline-secondary" >ROLL</button>
</div>
app = Flask(__name__)
@app.route('/')
def hello_world():
hook = result # тут содержится функция которая рандомно при обрезании выплевывает новое значение.
return render_template('index.html', hook = hook)
.....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question