[whatwg] Search-suggestions without scripting
Alexandre Morgaut
Alexandre.Morgaut at 4d.com
Wed Aug 17 01:12:57 PDT 2011
I like the idea of a declarative way to support autosuggestions
OpenSearch already made a successful specification supported by most browsers
http://www.opensearch.org/Specifications/OpenSearch/1.1
The datalist element may support dynamic content
The <datalist> element could support a template attribute similar to the one of OpenSearch
<label for="country_name">Country : </label>
<input id="country_name" name="country_name" type="text" list="suggestions" />
<datalist id="suggestions" template="http://myserver.com/suggestions.php?firstChars={value}"></datalist>
The response format should then be specified
In OpenSearch, the suggestions are all links with labels and sometimes descriptions. They can be returned as Atom, RSS, or HTML/XHTML depending of the requested MIME type.
The User-Agent should support at least a plain text response in which each suggestion is on a separated line.
These lines may or not contain HTML tags
It would quite logic to expect a response which would be a set of <option> elements as expected in the content of static <datalist> elements
We may also define specific MIME types like "application/datalist+xml" and "application/datalist+json"
On 15 août 2011, at 20:39, Aryeh Gregor wrote:
> On Sun, Aug 14, 2011 at 3:26 AM, Timo Beermann
> <timo.beermann at googlemail.com> wrote:
>> The search-suggestions of search-fields as in Google or Wikipedia
>> should be able without scripting, only with HTML/CSS. Because some
>> users deactivate Scripting (for security or whatever other reason) and
>> on other computers (school, university, work,...) you are not able to
>> change the settings, even if you want to. E.g. I use NoScript and only
>> allow scripting on very few trusted sites, that really need it.
>
> Scripting is generally necessary to get dynamic content. <datalist>
> can be used to provide search suggestions, but they'll be static if
> script is disabled. Proper suggest-as-you-type functionality is
> precisely the sort of thing that JavaScript is always going to be
> required for. Things that can already be done in script are usually
> only be made into declarative features if they meet a very high bar:
> they must be *very* commonly used, and there must be substantial
> benefit to typical users (not just ones who disable script) from
> having them available as declarative features.
Alexandre Morgaut
Product Manager
4D SAS
60, rue d'Alsace
92110 Clichy
France
Standard : +33 1 40 87 92 00
Email : Alexandre.Morgaut at 4d.com
Web : www.4D.com
More information about the whatwg
mailing list