Autocomplete Json from url Please help
hy, guys i have a problem i am trying to get autocomplet to show relevant information from an URL and i dont know how ... please help me.
here is the code ... Any info that could help me is important thank you very much
- <!doctype html>
-
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>Autocomplet</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
- <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
-
- <script type="text/javascript">
- $(function() {
- $("#hotel").autocomplete({
- source: function(request, response){
- $.ajax ({
- url: "https://tsbo-bbh.develop.inexweb.de/cms/rest/portal/search/autocomplete?input=?",
- dataType:"jsonp",
- data: {
- featureClass:"P",
- style:"full",
- maxRows:9,
- name_startsWith: request.term
- },
- success: function (data){
- response($.map(data.hotels, function(item){
- return {
- label: item.hotels,
- value: item.hotels
- }
- }));
- }
- });
- },
- minLength: 2,
- });
- });
-
- </script>
- </head>
-
- <body>
-
- <div class="ui-widget">
- <label for="hotel">hotel: </label><input id="hotel" /></div>
-
- <div class="ui-widget" style="margin-top: 2em; font-family: Arial;">Result:<div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
- </div>
- </body>
-
- </html>