-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (67 loc) · 2.42 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2015 Candidates | UK</title>
<!-- Mobile views -->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id='cssmenu'>
<ul>
<li class='active'><a href='index.html'>Home</a></li>
<li><a href="team.html">Team</a></li>
<div class="light">
<form id="search-mpi">
<span><input type="text" id="search-postcode" placeholder="Insert postcode..."></span>
</form>
</div>
</ul>
</div>
<h1>CANDID<style> h1 {color: #47c9af}</style>ates<style> h1 {color: black}></style></h1>
<span id='subtitle'>
<h2>| 2015 UK GENERAL ELECTION CANDIDATES AND CONTACT INFORMATION | </span></h2>
<div id="vis">
</div>
<div id="tooltip" class="hidden">
<p><strong id="constituency"></strong></p>
<p><span id="mp"></span></p>
<p><span id="party"></span></p>
<br>
<p><strong>2015 Candidates:</strong></p>
<p class="candidates_description">Name (Party) - Email and/or Twitter Handle</p>
<p><span id="next_elec"></span></p>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/queue-async/1.0.7/queue.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/topojson/1.1.0/topojson.min.js"></script>
<script src="maps.js"></script>
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
<script>
// To request and get data in Java Script Console:
var search_mpi = function() {
$.ajax({
url: "http://mapit.mysociety.org/postcode/SW1A1AA",
type : "GET",
dataType : "json",
success: function(response) {
console.log(response);
},
error: function(xhr, status, error){
console.log(status);
console.log(error);
}
});
};
$(document).ready(function(){
$('#search-mpi').on("submit", function(e){ // To use "Enter" to search
e.preventDefault();
var input = $('#search-postcode').val();
console.log(input);
search_mpi(input);
});
});
</script>
</body>
</html>