For example, we have a two pages: Home and AboutUs.
And also we have a simple navigations with two buttons: Home and AboutUs
When I click navigation button “AboutUs”, page “AboutUs” opens and that’s OK.
But when page “AboutUs” is already opened and I click on “AboutUS” button, page reloads again…
Soo, how can I prevent this unnecessary reloading?
I think that if r.URL.Path == “url path” handle function should return, but how to do it?
Emin Pogosbekov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
With JavaScript or css you can do this, without another call to the backend!
You should try to reduce calls to the backend!
<input type="text" id="myInput" value="This is an input field">
<script>
document.getElementById("disableBtn").addEventListener("click", function() {
document.getElementById("myInput").disabled = true; // Disable the input field
});
</script>
One example with button…