forked from swiftype/autocomplete-search-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (40 loc) · 1.68 KB
/
index.html
File metadata and controls
42 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html>
<head>
<title>Knowledge base</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery.swiftype.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="autocomplete.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,800,600,300,300italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<div id="searchboxContainer">
<div id="searchbox">
<img id="brain_geo" src="brain_geo.png" alt="brain_geo">
<h2 id="logo">knowledge base</h2>
<form id="search-form">
<!-- <input type="text" id="st-search-input">
<button type="submit">Search</button> -->
<input class="search-input" id="st-search-input" type="text" placeholder="Search for anything"/>
</form>
<script>
// set up autocomplete
$("#st-search-input").swiftype({
engineKey: "T6stQ2m7sf88bS7x75Vk"
});
// redirect form to results page with #stq hash parameter
$("#search-form").submit(function(event) {
event.preventDefault();
var query = $("#st-search-input").val();
// set the location to be the URL of your search results page
// For this example, it's results.html.
window.location = "results.html#stq=" + query;
});
</script>
</div>
</div>
<img src="taqtile-horizontal.png" id="taqtile-logo"/>
</body>
</html>