I'm in need of assistance with reloading two elements on my webpage. I am working with small electronics and the NodeMCU as its brain. I require two outputs (connected to relays) and two inputs.
For the inputs, I would like them to update periodically without manually refreshing the webpage. To achieve this, I am using ajax. I have come across some helpful information at:
Most aspects are functioning perfectly (outputs and inputs). The only issue is that after a timeout, the entire webpage reloads and appears twice in the web browser.
Apologies for providing my code as an image below. When I try to insert it as text, certain parts may be recognized as HTML tags and not displayed properly. I have added the code to my webpage:
If anyone could offer advice on what might be wrong with my code (below), I would greatly appreciate it.
Thank you in advance to everyone who can help. https://i.sstatic.net/W1JB7.png
My code: