I made an HTML form in which there are a lot of questions (coming from the database) on different tabs. The user then answers these questions. Every time the user changes the tab, my Javascript creates a save. The problem is that I have to iterate over all the questions every time the tab is changed, and it freezes the form for about 5 seconds every time.
I was looking for an answer on how I can run the save function in the background. There seems to be no real way to run something in the background, and many recommend using setTimeout();
For example, this How to get a group of js function running in the background
But none of these examples explains or takes into account that even if I use something like setTimeout(saveFunction, 2000);
This does not solve my problem. In this case, he puts it off for 2 seconds.
Is there any way to solve this problem?
source share