From 1382af8af0196a0bce10d8c58f449d2320cdf8a9 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Tue, 26 Jan 2010 20:52:21 +0000 Subject: autocomplete: added xml-parsing demo --- demos/autocomplete/index.html | 1 + demos/autocomplete/london.xml | 114 ++++++++++++++++++++++++++++++++++++++++++ demos/autocomplete/xml.html | 68 +++++++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 demos/autocomplete/london.xml create mode 100644 demos/autocomplete/xml.html diff --git a/demos/autocomplete/index.html b/demos/autocomplete/index.html index ffca515e0..3063d8db8 100644 --- a/demos/autocomplete/index.html +++ b/demos/autocomplete/index.html @@ -14,6 +14,7 @@
  • Remote JSONP datasource
  • Combobox
  • Custom data and display
  • +
  • XML data parsed once
  • diff --git a/demos/autocomplete/london.xml b/demos/autocomplete/london.xml new file mode 100644 index 000000000..262854998 --- /dev/null +++ b/demos/autocomplete/london.xml @@ -0,0 +1,114 @@ + + +6987 + +London +51.5084152563931 +-0.125532746315002 +2643743 +GB +United Kingdom + +P +PPLC + + +London +42.983389283 +-81.233042387 +6058560 +CA +Canada + +P +PPL + + +East London +-33.0152850934643 +27.9116249084473 +1006984 +ZA +South Africa + +P +PPL + + +City +51.5133363996235 +-0.0890064239501953 +2643744 +GB +United Kingdom + +A +ADM2 + + +London +37.1289771 +-84.0832646 +4298960 +US +United States + +P +PPL + + +The Tower of London +51.5082349601834 +-0.0763034820556641 +6286786 +GB +United Kingdom + +S +CSTL + + +London Reefs +8.85 +112.5333333 +1879967 + + + +U +RFSU + + +Greater London +51.5 +-0.1666667 +2648110 +GB +United Kingdom + +A +ADM2 + + +London +46.1666667 +6.0166667 +2661811 +CH +Switzerland + +H +STM + + +London Borough of Islington +51.5333333 +-0.1333333 +3333156 +GB +United Kingdom + +A +ADM2 + + diff --git a/demos/autocomplete/xml.html b/demos/autocomplete/xml.html new file mode 100644 index 000000000..92a089b56 --- /dev/null +++ b/demos/autocomplete/xml.html @@ -0,0 +1,68 @@ + + + + jQuery UI Autocomplete Remote datasource demo + + + + + + + + + + + +
    + +
    + + +
    + +
    + Result: +
    +
    + +
    + +
    +

    +This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource. +

    +

    +This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback. +

    +
    + + + -- cgit v1.2.3