basic jquery autocomplete with remote data source --how? -


what proper way autocomplete working remote data? read document @

http://docs.jquery.com/plugins/autocomplete

and ran example code. example worked fine local data stored in js array, when used remote url, doesn't work. see autocomplete http request being generated, , can see local web server responding correct data. autocomplete info not pop up.

here .html code, different 2 lines example in jquery documentation:

<html> <head>   <script src="http://code.jquery.com/jquery-latest.js"></script>   <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/main.css" type="text/css" />   <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" />   <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js"></script>   <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.dimensions.js"></script>   <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"></script>   <script>   $(document).ready(function(){      url = "http://localhost:8000/autocomplete/"      $("#example").autocomplete(url);   });   </script>     </head>    <body>      api reference: <input id="example" /> (try "c" or "e")    </body> </html> 

is there else needed in .htm file? should change data format returned server? when type "fr" text box, server returns this:

["fractal","fractal","fractalzebra","frad","fraet",] 

i trying display simple list of strings, don't need include additional data in server response unless turns out required jquery.

thanks in advance, problem has been stumping me.

-travis

make sure you're not running same origin policy issue which, prior jquery 1.5, required different origin domain ajax calls jsonp, , implementable crossdomain:true. far autocomplete plugin goes, i'm not aware how fetches data might not applicable, said local version working , remote data not made me think of immediately.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -