weixin_33712987 2018-06-10 10:12 采纳率: 0%
浏览 13

自动提示和ajax调用

I am working with the autosuggestion search. The problem is I have a "keyup" event that sends an ajax request to the database on the change of the search query term. From time to time it happens that user quickly changes those search query terms. What I mean by that:

1) User enters "123" -> an ajax request to the database is sent. 2) Right after that, very rapidly, he decides to drop '3' from "123" -> a new ajax request with "12" as a new search query is sent to the database. The second request fetches the data faster than the first one. And this leads to the situation when the search query remains correct, but the list of found products is not as first request with its fetched data rewrites the second one. It should be vice verse.

Please, help me come up with some ideas on how I can, like, synchronize those two request

Kind regards!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 onlyoffice编辑完后立即下载,下载的不是最新编辑的文档
    • ¥15 求caverdock使用教程
    • ¥15 Coze智能助手搭建过程中的问题请教
    • ¥15 12864只亮屏 不显示汉字
    • ¥20 三极管1000倍放大电路
    • ¥15 vscode报错如何解决
    • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
    • ¥15 python随机森林对两个excel表格读取,shap报错
    • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
    • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。