javascript - What should I do if the interface return time is inconsistent when using controls such as _.debounce to delay the input delay ajax call?
漂亮男人
漂亮男人 2017-07-05 10:47:21
0
1
779

The onChange event in react's input is bound to a handleOnchange method. After this method is called, the ajax call is delayed. If the user enters "Glory of the King", due to typing speed issues, two requests for "King of Glory" may be sent in the end. ”, “Glory of the King”. .

At this time, the first "King of Glory" request takes longer to return than the second "King of Glory" request. The final rendered result is that the user sees that the input box is "King of Glory", but the result is "King of Glory" "The results are covered.

Is there any technical solution to avoid this situation?

漂亮男人
漂亮男人

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!