Note that there are some explanatory texts on larger screens.

plurals
  1. POAutocomplete jQuery 1.8-UI JSON Format
    primarykey
    data
    text
    <p>I'm toying with the new autocomplete in jQuery 1.8-UI. I've provided data in the following format</p> <pre><code>["val1", "val2", "val3"] </code></pre> <p>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</p> <pre><code>var data = ["val1", "val2", "val3"]; </code></pre> <p>Then this works fine.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() $("#txtClient").autocomplete({ source: "/intranet/common/scripts/IntranetLists.aspx?ListType=C" }); }); &lt;/script&gt; </code></pre> <p>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 <a href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" rel="nofollow noreferrer">bassistence's autocomplete</a>.</p> <p>Any ideas?</p> <hr> <p><strong>EDIT</strong></p> <p>The source simply outputs an entry on separate lines. Now the output does it with JSON format. What I don't understand is how the input provides the data as a query to the source of data. As I say, I'm using a script which <em>should</em> get called every time I enter a new key.</p> <p>Here's the code I've got (take into account this worked fine with a third-party autocomplete plugin)</p> <pre><code>&lt;% Dim MyCmd As New dbExact("proc_Intranet_Lists") MyCmd.cmd.Parameters("@List").Value = Request.QueryString("ListType") If Request.QueryString("Top") &lt;&gt; Nothing Then MyCmd.cmd.Parameters("@Top").Value = Request.QueryString("Top") End If MyCmd.cmd.Parameters("@Code").Value = Request.QueryString("term") MyCmd.cmd.Connection.Open() Dim results As New StringBuilder() results.Append("[") Dim dr As SqlDataReader = MyCmd.cmd.ExecuteReader If dr.HasRows Then While dr.Read results.AppendLine("'" + dr(0).ToString() + "',") End While Else results.Append("None Found") End If results.Remove(results.Length - 2, 2) results.Append("]") Response.Write(results.ToString()) results = Nothing MyCmd.cmd.Connection.Close() MyCmd = Nothing %&gt; </code></pre> <p>The documentation for the new autocomplete doesn't state anywhere that the query string passed is actually called "term" (which I found out from the search.php file). I'm doing this in VB.NET.</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.
    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