Think you hit it with the missing "var" on the variables.
Once again working and with JSON !
BTW there are no links to the JSON example on the site but I did see it in
the download.
Nathan
On Mon, Sep 22, 2008 at 11:49 AM, Jörn Zaefferer <
[EMAIL PROTECTED]> wrote:
> The url shouldn't contain that query string. Local variables should be
> declared with var. Everything else looks fine.
>
> Could you post a testpage?
>
> Jörn
>
> On Mon, Sep 22, 2008 at 7:29 PM, Nathan Maves <[EMAIL PROTECTED]>
> wrote:
> > Hmm I must be doing something wrong.... The alerts all look good but
> there
> > is no drop down now. It used to work before when the result was text
> based
> > but now that it is back to json the drop down is not showing.
> >
> >
> >
> > JS
> >
> > $("#flying_from").autocomplete({
> > url: "findAirports?q=",
> > width: 300,
> > delay: 200,
> > minChars: 2,
> > parse: function(data) {
> > //alert(data);
> > cities = eval('(' + data + ')');
> > return $.map(eval(data), function(element) {
> > //alert(element);
> > airportName = element.substring(0,
> > element.indexOf('('));
> > airportCode =
> > element.substring(element.indexOf("(")+1,element.indexOf(")"));
> > //alert(airportCode);
> > return {
> > data: element,
> > value: airportCode,
> > result: element
> > }
> > });
> > },
> > formatItem: function(item) {
> > return item;
> > }
> > });
> >
> >
> > JSON Result
> >
> > ['Akron Canton, OH (CAK)', 'Cancun, MX (CUN)']
> >
> > On Mon, Sep 22, 2008 at 10:59 AM, Jörn Zaefferer
> > <[EMAIL PROTECTED]> wrote:
> >>
> >> No, the parse option exists since 1.0.
> >>
> >> Jörn
> >>
> >> On Mon, Sep 22, 2008 at 6:54 PM, Nathan Maves <[EMAIL PROTECTED]>
> >> wrote:
> >> > Is it dependent on 1.0.2?
> >> >
> >> > On Mon, Sep 22, 2008 at 10:33 AM, Jörn Zaefferer
> >> > <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> It simply isn't documented, yet.
> >> >>
> >> >> Jörn
> >> >>
> >> >> On Mon, Sep 22, 2008 at 6:30 PM, Nathan Maves <
> [EMAIL PROTECTED]>
> >> >> wrote:
> >> >> > Perfect. That is what I expected but the docs located below say
> >> >> > nothing
> >> >> > about a parse option :)
> >> >> >
> >> >> > http://docs.jquery.com/UI/Autocomplete/autocomplete#options
> >> >> >
> >> >> >
> >> >> > Where can the latest docs be found?
> >> >> >
> >> >> >
> >> >> >
> >> >> > On Sat, Sep 20, 2008 at 6:42 AM, Jörn Zaefferer
> >> >> > <[EMAIL PROTECTED]> wrote:
> >> >> >>
> >> >> >> There is an example using JSON here:
> >> >> >> http://jquery.bassistance.de/autocomplete/demo/json.html
> >> >> >> Still needs to be moved/updated to reflect the UI migration, but
> >> >> >> should work nonetheless.
> >> >> >>
> >> >> >> Jörn
> >> >> >>
> >> >> >> On Thu, Sep 18, 2008 at 11:06 PM, Nathan <[EMAIL PROTECTED]>
> >> >> >> wrote:
> >> >> >> >
> >> >> >> > Nice little component but not all the expendable.
> >> >> >> >
> >> >> >> > I have a url that returns JSON as the result. I need a way to
> >> >> >> > either
> >> >> >> > process the result of the query or we should have an option to
> >> >> >> > user
> >> >> >> > the jQuery.getJSON( url, data, callback ) method of jquery.
> >> >> >> >
> >> >> >> > We could set an option for text/json/xml to parse the data for
> all
> >> >> >> > three ways
> >> >> >> >
> >> >> >> > >
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> > >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >> > >
> >> >
> >>
> >>
> >
> >
> > >
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---