简体   繁体   English

jQuery UI AutomComplete-请求中止

[英]jQuery UI AutomComplete - Request aborted

I noticed that jQuery UI Auto-Complete will "abort" some HTTP requests if user is typing fast. 我注意到,如果用户快速键入,jQuery UI Auto-Complete将“中止”一些HTTP请求。 Will those request still hit the service? 那些请求还会继续服务吗? If it is, is there anyway to reduce the requests being send besides setting delay or minimum typed in letter? 如果是的话,除了设置延迟或最小键入字母以外,是否还有其他方法可以减少发送的请求?

Yes, is possible by setting delay on your autocomplete definition. 是的,可以通过在autocomplete定义中设置delay来实现。

$( ".selector" ).autocomplete({ delay: 500 });

The delay in milliseconds between when a keystroke occurs and when a search is performed. 发生击键和执行搜索之间的延迟(以毫秒为单位)。 A zero-delay makes sense for local data (more responsive), but can produce a lot of load for remote data, while being less responsive. 零延迟对本地数据有意义(响应速度更快),但在响应速度较慢的情况下,可能会为远程数据产生大量负载。

Reference: http://api.jqueryui.com/autocomplete/#option-delay 参考: http : //api.jqueryui.com/autocomplete/#option-delay

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM