Changeset 212


Ignore:
Timestamp:
Oct 27, 2006, 8:28:06 PM (13 years ago)
Author:
Nick Burch
Message:

Support displaying outer and outer+1 problem postcodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/distantPostcodes.html

    r206 r212  
    99<h1>Distant Postcodes</h1>
    1010
     11<div id="actions">
     12</div>
     13
     14<br />
     15
    1116<div id="distant">
    1217</div>
    1318
    1419<script type="text/javascript">
     20var actions = document.getElementById("actions");
    1521var distant = document.getElementById("distant");
    1622
     
    4248        distant.appendChild(div);
    4349}
     50
     51// How should we call the script?
     52var cgi = "/cgi/get-distant-postcodes.fcgi";
     53var oLink = document.createElement("a");
     54if(location.href.indexOf("?outer1") > 0) {
     55        cgi = cgi + "?outer1=yes";
     56        oLink.href = "?";
     57        oLink.appendChild(document.createTextNode("Match only by outer parts"));
     58} else {
     59        oLink.href = "?outer1=yes";
     60        oLink.appendChild(document.createTextNode("Match by outer in 1st inner"));
     61}
     62actions.appendChild(oLink);
     63
     64// Include the script
     65var sc = document.createElement("script");
     66sc.type = "text/javascript";
     67sc.src = cgi;
     68actions.appendChild(sc);
    4469</script>
    45 
    46 <!-- Can also do get-distant-postcodes.fcgi?outer1=yes -->
    47 <script type="text/javascript" src="/cgi/get-distant-postcodes.fcgi"></script>
    4870
    4971</body>
Note: See TracChangeset for help on using the changeset viewer.