source: trunk/npemap.org.uk/static/distantPostcodes.html @ 200

Last change on this file since 200 was 200, checked in by Nick Burch, 14 years ago

Add a stub distant postcodes page

File size: 1.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
3<html>
4<head>
5  <title>Distant Postcodes | New Popular Edition Maps</title>
6</head>
7
8<body>
9<h1>Distant Postcodes</h1>
10
11<div id="distant">
12</div>
13
14<script type="text/javascript">
15var distant = document.getElementById("distant");
16
17function addProblem(id,postcode,matchpart,easting,northing,avg_e,avg_n) {
18        var div = document.createElement("div");
19        div.appendChild(document.createTextNode(postcode + " (" + id + "), matched from " + matchpart + ", was at "));
20
21        var pl = document.createElement("a");
22        pl.appendChild(document.createTextNode(easting + " " + northing));
23        pl.href = "map.html#" + Math.round(easting/1000) + "," + Math.round(northing/1000) + ",1";
24        div.appendChild(pl);
25
26        div.appendChild(document.createTextNode(", instead of at "));
27
28        var al = document.createElement("a");
29        al.appendChild(document.createTextNode(avg_e + " " + avg_e));
30        al.href = "map.html#" + Math.round(avg_e/1000) + "," + Math.round(avg_n/1000) + ",1";
31        div.appendChild(al);
32
33        var e_km = Math.abs(Math.round((easting-avg_e)/1000));
34        var n_km = Math.abs(Math.round((northing-avg_n)/1000));
35        div.appendChild(document.createTextNode(", out by " + e_km + "km and " + n_km + "km"));
36
37        distant.appendChild(div);
38}
39</script>
40<script type="text/javascript" src="/cgi/get-distant-postcodes.fcgi"></script>
41
42</body>
43</html>
Note: See TracBrowser for help on using the repository browser.