简体   繁体   中英

JQuery Autocomplete remote data

I've got it to work, and I have looked online and through the documentation, it's not very useful for some reason!

Given this code that works as expected:

<input type="text" id="color_input" />
<script type="text/javascript">
    jQuery('#color_input').autocomplete('autoComplete.aspx');
</script>

What I can't figure out is how what the user has typed is sent to the autoComplete.aspx page? For example if I type in 'Thoma' how is 'Thoma' sent to the processing page?

Does it send it via querystring? Or post it?

It uses a GET request with a q=Thoma in the querystring as mentioned in the documentation .

If you turn on Firebug or HTTP Headers you should be able to trap the outgoing requests and examine them.

You change the request to use POST by setting the options

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