PageRenderTime 27ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/EasyAutocomplete-master/demo/example_duckduckgo.html

https://bitbucket.org/quickfinder/quickfinder-old
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
 1<!DOCTYPE html>
 2<html lang="en">
 3	<head>
 4		<title>EasyAutocomplete duckduckgo example</title>
 5		<link href="../dist/easy-autocomplete.min.css" rel="stylesheet" type="text/css">
 6		<script src="../lib/jquery-1.11.2.min.js"></script>
 7		<script src="../dist/jquery.easy-autocomplete.min.js" type="text/javascript" ></script>
 8	</head>
 9	<body>
10
11		<h1>EasyAutocomplete - duckduckgo example</h1>
12
13		<input id="ddg" />
14
15		<script>
16
17		var options = {
18			url: function(phrase) { 
19				return phrase !== "" ? "http://api.duckduckgo.com/?q=" + phrase + "&format=json" : "http://api.duckduckgo.com/?q=empty&format=json";
20			},
21
22			getValue: "Text",
23
24			ajaxSettings: {
25				dataType: "jsonp"
26			},
27
28			listLocation: "RelatedTopics",
29		};
30
31		$("#ddg").easyAutocomplete(options);
32
33		</script>
34
35	</body>
36
37</html>