Skip to content

Commit c91ac2a

Browse files
committed
Autocomplete: Fix JSONP description for source option
Fixes gh-316 Closes gh-317
1 parent ee2949e commit c91ac2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entries/autocomplete.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@
8585
</desc>
8686
</type>
8787
<type name="String">
88-
<desc>When a string is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must provide JSONP). The Autocomplete plugin does not filter the results, instead a query string is added with a <code>term</code> field, which the server-side script should use for filtering the results. For example, if the <code>source</code> option is set to <code>"http://example.com"</code> and the user types <code>foo</code>, a GET request would be made to <code>http://example.com?term=foo</code>. The data itself can be in the same format as the local data described above.</desc>
88+
<desc>When a string is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data. It can be on the same host or on a different one (must support CORS). The Autocomplete plugin does not filter the results, instead a query string is added with a <code>term</code> field, which the server-side script should use for filtering the results. For example, if the <code>source</code> option is set to <code>"http://example.com"</code> and the user types <code>foo</code>, a GET request would be made to <code>http://example.com?term=foo</code>. The data itself can be in the same format as the local data described above.</desc>
8989
</type>
9090
<type name="Function">
9191
<argument name="request" type="Object"/>
9292
<argument name="response" type="Function">
9393
<argument name="data" type="Object"/>
9494
</argument>
9595
<desc>
96-
The third variation, a callback, provides the most flexibility and can be used to connect any data source to Autocomplete. The callback gets two arguments:
96+
The third variation, a callback, provides the most flexibility and can be used to connect any data source to Autocomplete, including JSONP. The callback gets two arguments:
9797
<ul>
9898
<li>A <code>request</code> object, with a single <code>term</code> property, which refers to the value currently in the text input. For example, if the user enters <code>"new yo"</code> in a city field, the Autocomplete term will equal <code>"new yo"</code>.</li>
9999
<li>A <code>response</code> callback, which expects a single argument: the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data. It's important when providing a custom source callback to handle errors during the request. You must always call the <code>response</code> callback even if you encounter an error. This ensures that the widget always has the correct state.</li>

0 commit comments

Comments
 (0)