Situation
ex) Input: 3 -> What is entered in py. Gugudan of the input value (only an example, the actual code is very Kim) -> Output the execution result of py to html (graph or character)
When I searched Google God, there are many examples of using Ajax, but I don't know how to access it from the website I already implemented because it's a format where html starts when I run localhost:5000 or py.
Conclusion: I would like to send a specific input value of html with py and return the execution result of py to html at the same time.
html ajax python py
<aid="resultDemander"> What are the results?</a>
<div id="resultContainer"></div>
<!-- Assume that you write roughly jQuery -->
<script>
$('#resultDemander').click(function(e) {
e.preventDefault();
$.ajax({
method: 'GET',
url: 'http://foobar.com/magic'
dataType: 'html'
}).done(function (response) {
$('#resultContainer').html(response);
});
});
</script>
Pretend to be fooled and follow along. If there is something you don't understand while doing , please post it as a separate new question.
© 2024 OneMinuteCode. All rights reserved.