Let’s first list the implementation of Ajax in Jquery and prototype.
Jquery:
prototype:
Actually, the prototype cannot be refreshed after the setInterval function is introduced. Why is this?
It turns out that the prototype has a caching mechanism for the same URL, so the page cannot be refreshed. Especially after the user uses F5 or clicks "Refresh", there will be a bug that the Ajax response area is blank, so the prototype must not be refreshed.
Add a random number to the URL in the prototype
Original: var remoteUrl = 'index.php';
After modification: var remoteUrl = 'index.php?rand=' Math.random();
Use the GET method to generate a parameter that has nothing to do with page display.