Note that there are some explanatory texts on larger screens.

plurals
  1. PObasic jquery autocomplete with remote data source --how?
    primarykey
    data
    text
    <p>What is the proper way to get autocomplete working with remote data? I read the document at </p> <p><a href="http://docs.jquery.com/Plugins/Autocomplete" rel="nofollow">http://docs.jquery.com/Plugins/Autocomplete</a></p> <p>and ran the example code. The example worked just fine for local data stored in a JS array, but when I used a remote URL, it doesn't work. I see the autocomplete HTTP request being generated, and I can see my local web server responding with the correct data. But the autocomplete info does not pop up.</p> <p>Here is my .html code, it is only different by 2 lines from the example in the jquery documentation:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/main.css" type="text/css" /&gt; &lt;link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" /&gt; &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.dimensions.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ url = "http://localhost:8000/autocomplete/" $("#example").autocomplete(url); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; API Reference: &lt;input id="example" /&gt; (try "C" or "E") &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Is there anything else needed in the .htm file? Should I change the data format returned by the server? Currently when I type "fr" into the text box, my server returns this:</p> <pre><code>["fractal","FRACTAL","fractalzebra","frad","Fraet",] </code></pre> <p>I am just trying to display a simple list of strings, I don't need to include any additional data in the server response unless it turns out to be required by jquery.</p> <p>Thanks in advance, this problem has really been stumping me.</p> <p>-Travis</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload