简体   繁体   中英

jQuery UI AutomComplete - Request aborted

I noticed that jQuery UI Auto-Complete will "abort" some HTTP requests if user is typing fast. 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.

$( ".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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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