I am new to web technologies, trying to build a basic website. Technology stack: Python+Flask and HTML+CSS+JS on frontend.
I have a button, from which I am trying to redirect to a relative URL: Button html:
<div class="form-group">
<input type="submit"
class="btn btn-primary btn-lg btn-block pb_btn-pill btn-shadow-blue"
value="Register"
onclick="approve()">
</div>
Javascript:
function approve() {
window.location.href = '/approve';
}
This is not taking me to: http://127.0.0.1:5000/approve rather to: http://127.0.0.1:5000/?
Can anyone please guide?
SOLUTION: Thank you all, this helped: return false https://stackoverflow.com/a/26518061/4253760
I still have a question, what is this URL with ? mark http://127.0.0.1:5000/?