search

Home  >  Q&A  >  body text

javascript - synchronization expiration problem of linkage menu

Today I saw an article that implements an infinite linkage menu. I saw that the author did not understand it when dealing with data expiration;

Can you figure out the reason for the first expiration? What is the reason for the second one? How did it happen?

我想大声告诉你我想大声告诉你2751 days ago506

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-18 11:00:31

    As the author said, it is a timeout function with a buffer time of 0. If the update of the first-level menu to the second-level menu is written in the setTimeout() function, it is an asynchronous operation. It will also happen that subsequent operations update the interface first, and the results of the previous operations expire.

    reply
    0
  • Cancelreply