[html5] Large Datalist

Doug Hardie bc979 at lafn.org
Fri May 4 00:10:07 PDT 2012


That certainly eliminates the error and now I see that script in the browser.  I am unable to figure out how to reference a variable in a HTML element.  I tried the following but it doesn't work (I didn't think it would):

<INPUT NAME=place SIZE=48 MAXLENGTH=64 VALUE='xxx' LIST=datalist>.

It kept facilities as a string rather than using the var.

The following attempt to just check the var also failed:

<script>alert (datalist)</script>

That gives an alert dialog with [object Object].

I suspect I will need something like "<script>document.write (datalist)</script in the right place in the datalist html.  But I think I need to get the variable working first.


On 3 May 2012, at 23:29, Tatham Oddie wrote:

> You'll need to put it in a variable to access it later.
> 
>    var datalist = {
>        "ID": "facilities",
>        "OPTION": [
>            {"LABEL": "St. Johns Hospital, Oxnard", "VALUE": "St. Johns"},
>            {"LABEL": "Pleasant Valley, Camarillo", "VALUE": "Pleasant Valley"},
>            {"LABEL": "Los Robles Hospital, Thousand Oaks", "VALUE": "Los Robles"}
>        ]
>    };
> 
> -- Tatham
> 
> -----Original Message-----
> From: Doug Hardie [mailto:bc979 at lafn.org] 
> Sent: Friday, 4 May 2012 4:17 PM
> To: Tatham Oddie; help at lists.whatwg.org
> Subject: Re: [html5] Large Datalist
> 
> 
> On 3 May 2012, at 23:16, Doug Hardie wrote:
> 
>> Great idea.  Here is the content of the js file:
>> 
>> {"DATALIST": {
>>       "ID": "facilities",
>>       "OPTION": [
>>               {"LABEL": "St. Johns Hospital, Oxnard", "VALUE": "St. Johns"},
>>               {"LABEL": "Pleasant Valley, Camarillo", "VALUE": "Pleasant Valley"},
>>               {"LABEL": "Los Robles Hospital, Thousand Oaks", "VALUE": "Los Robles"}
>>       ]
>> }}
>> 
>> Loading it with:
>> 
>> <SCRIPT SRC=/RSS/bin/facilities.script></SCRIPT>
>> 
>> I get an "Unexpected token ":" on the first line.  Have I done something wrong?
>> 
>> 
>> 
>> On 3 May 2012, at 16:17, Tatham Oddie wrote:
>> 
>>> Store it as JSON and load it as a .js file?
>>> 
>>> -- Tatham
>>> 
>>> 
>>> -----Original Message-----
>>> From: help-bounces at lists.whatwg.org [mailto:help-bounces at lists.whatwg.org] On Behalf Of Doug Hardie
>>> Sent: Friday, 4 May 2012 9:13 AM
>>> To: help at lists.whatwg.org
>>> Subject: [html5] Large Datalist
>>> 
>>> I have a large datalist that I would like to store in a file that can be downloaded to the browser when the user first establishes a session and then is used by the browser much like a javascript file.  Is there any way to do that?
>>> _______________________________________________
>>> Help mailing list
>>> Help at lists.whatwg.org
>>> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
>>> 
>> 
> 
> 




More information about the Help mailing list