Page tree

Versions Compared

Key

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

...

Code Block
languagexml
<input id="email" name="email" type="text" size="100"/>
<link href="https://dadata.ru/static/css/lib/suggestions-15.810.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!--[if lt IE 10]>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.1/jquery.xdomainrequest.min.js"></script>
<![endif]-->
<script type="text/javascript" src="https://dadata.ru/static/js/lib/jquery.suggestions-15.810.min.js"></script>
<script type="text/javascript">
    $("#email").suggestions({
        serviceUrl: "https://dadata.ru/api/v2",
        token: "ВАШ API-КЛЮЧ",
        type: "EMAIL",
        /* Вызывается, когда пользователь выбирает одну из подсказок */
        onSelect: function(suggestion) {
            console.log(suggestion);
        }
    });
</script>

...

Code Block
languagexml
<input id="email" name="email" type="text" size="100"/>
<link href="http://suggestions.dadata.ru/suggestions/libs/jquery.suggestions/15.810/css/suggestions.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!--[if lt IE 10]>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.1/jquery.xdomainrequest.min.js"></script>
<![endif]-->
<script type="text/javascript" src="http://suggestions.dadata.ru/suggestions/libs/jquery.suggestions/15.810/js/jquery.suggestions.js"></script>
<script type="text/javascript">
    $("#email").suggestions({
        serviceUrl: "http://suggestions.dadata.ru/suggestions/api/4_1/rs",
        token: "ВАШ API-КЛЮЧ",
        type: "EMAIL",
        /* Вызывается, когда пользователь выбирает одну из подсказок */
        onSelect: function(suggestion) {
            console.log(suggestion);
        }
    });
</script>

...

Code Block
languagehtml/xml
<input id="email" name="email" type="text" size="100"/>
<link href="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/15.810/css/suggestions.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!--[if lt IE 10]>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.1/jquery.xdomainrequest.min.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ВАШ_СЕРВЕР:ПОРТ/suggestions/libs/jquery.suggestions/15.810/js/jquery.suggestions.js"></script>
<script type="text/javascript">
    $("#email").suggestions({
        serviceUrl: "http://ВАШ_СЕРВЕР:ПОРТ/suggestions/api/4_1/rs",
        type: "EMAIL",
        /* Вызывается, когда пользователь выбирает одну из подсказок */
        onSelect: function(suggestion) {
            console.log(suggestion);
        }
    });
</script>

...