/plugins/EasyAutocomplete-master/demo/example_duckduckgo.html
HTML | 37 lines | 26 code | 11 blank | 0 comment | 0 complexity | c1c830283b2eba58e836c05510f6129b MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, MPL-2.0-no-copyleft-exception, MIT
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>EasyAutocomplete duckduckgo example</title>
- <link href="../dist/easy-autocomplete.min.css" rel="stylesheet" type="text/css">
- <script src="../lib/jquery-1.11.2.min.js"></script>
- <script src="../dist/jquery.easy-autocomplete.min.js" type="text/javascript" ></script>
- </head>
- <body>
- <h1>EasyAutocomplete - duckduckgo example</h1>
- <input id="ddg" />
- <script>
- var options = {
- url: function(phrase) {
- return phrase !== "" ? "http://api.duckduckgo.com/?q=" + phrase + "&format=json" : "http://api.duckduckgo.com/?q=empty&format=json";
- },
- getValue: "Text",
- ajaxSettings: {
- dataType: "jsonp"
- },
- listLocation: "RelatedTopics",
- };
- $("#ddg").easyAutocomplete(options);
- </script>
- </body>
- </html>