Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

DaData.ru

https://dadata.ru/suggestions/usage/bank/

«Коробка» до 19.7

Code Block
languagehtml/xml
<input id="bank" name="bank" type="text" />
<link href="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/masterstable/css/suggestions.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/masterstable/js/jquery.suggestions.js"></script>
<script type="text/javascript"><script>
    $("#bank").suggestions({
        serviceUrl: "http://ВАШ_СЕРВЕР:ПОРТ/suggestions/api/4_1/rs",
        type: "BANK",
        /* Вызывается, когда пользователь выбирает одну из подсказок */
        onSelect: function(suggestion) {
            console.log(suggestion);
        }
    });
</script>

...

Expand
titleВерсии до 19.7

...

html/
Code Block
language
xml
<input id="bank" name="bank" type="text" />
<link href="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/
stable
master/css/suggestions.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/
stable
master/js/jquery.suggestions.js"></script>
<script type="text/javascript">
    $("#bank").suggestions({
        serviceUrl: "http://ВАШ_СЕРВЕР:ПОРТ/suggestions/api/4_1/rs",
        type: "BANK",
        /* Вызывается, когда пользователь выбирает одну из подсказок */
        onSelect: function(suggestion) {
            console.log(suggestion);
        }
    });
</script>


Аргумент  suggestion  функции  onSelect  выглядит так:

...