-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
67 lines (54 loc) · 1.99 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
<html>
<head>
<title>jQuery GeoNames Input Demo</title>
<!-- Load jQuery from Google CDN -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<!-- jQuery UI -->
<link rel="stylesheet" href="stylesheets/jquery-ui-1.8.7.custom.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="javascripts/jquery-ui-1.8.7.custom.min.js" type="text/javascript" charset="utf-8"></script>
<!-- Maxmind GeoIP Service -->
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<!-- Load jQuery GeoNames Input Plugin -->
<script type="text/javascript" src="javascripts/jquery.geonames_input.js"></script>
<!-- Quick & Dirty Styling -->
<style>
body{
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}
label{
display: block;
margin-bottom: 5px;
}
p{
padding: 0px;
margin: 5px 0;
font-size: 10px;
}
input.ui-geoname-input{
background: white;
border: #aeaeae solid 1px;
font-size: 16px;
width: 400px;
padding: 5px;
}
input.ui-geoname-input:focus{
border-color: #444;
}
input.ui-geoname-input.ui-autocomplete-loading{
background: url(images/loading.gif) right center no-repeat;
}
</style>
</head>
<body>
<label>Your Location:</label>
<input type="text" id="geoname" class="ui-geoname-input"></input>
<p><i>Powered by <a href="http://www.maxmind.com/">Maxmind</a> and <a href="http://www.geonames.org">Geonames.org</a>.</i></p>
<script type="text/javascript">
// Location
if($("input#geoname").val().length == 0){
$("input#geoname").val(geoip_city() + ", " + geoip_region_name() + ", " + geoip_country_name());
}
$("input#geoname").geoname("en");
</script>
</body>
</html>