Autocomplete jQuery 1.8-UI JSON Format

Posted by Kezzer on Stack Overflow See other posts from Stack Overflow or by Kezzer
Published on 2010-03-25T16:16:22Z Indexed on 2010/03/25 16:23 UTC
Read the original article Hit count: 234

Filed under:

I'm toying with the new autocomplete in jQuery 1.8-UI. I've provided data in the following format

["val1", "val2", "val3"]

This is coming from a stored procedure but output as a string. For some reason this doesn't work at all, however, if I supply the same data using a javascript variable

var data = ["val1", "val2", "val3"];

Then this works fine.

<script type="text/javascript">
  $(function()
    $("#txtClient").autocomplete({
      source: "/intranet/common/scripts/IntranetLists.aspx?ListType=C"
    });
  });
</script>

I've got a page which supplies whatever data I want using query strings. It's more temporary, but it worked when I previously used bassistence's autocomplete.

Any ideas?

© Stack Overflow or respective owner

Related posts about jquery-ui