X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=index.html.in;h=5a83e47422c62f5c6ace4fe81ef1be6e07be9ed1;hb=15906744f92a96b44c962f69f28aa220cf80e84f;hp=1584284c0db404712d0ace4dc40ea9eced114ac8;hpb=c7dd518626122b5e76e5a9bdfd208d06a425df6b;p=charm-bypass.git diff --git a/index.html.in b/index.html.in index 1584284..5a83e47 100644 --- a/index.html.in +++ b/index.html.in @@ -439,10 +439,15 @@ /************************/ /* Set the service zone */ /************************/ - function set_service_zone(zone) { - /* We can take the zone as a parameter too; this allows - * us to use this function for the (computed) MARC Train - * zone and not just the querystring Commuter Bus zone */ + function set_service_zone(event, zone) { + /* We can take the zone as a parameter too; this allows us to + * use this function for the (computed) MARC Train zone and + * not just the querystring Commuter Bus zone. The extra + * "event" parameter is there for the event listener, which + * would otherwise stuff an onload event into the zone + * parameter. "Thankfully" javascript lets us call a + * two-argument function with one argument and thereby abuse + * the event handler for this. */ const z = document.getElementById("zone"); const params = new URLSearchParams(document.location.search); @@ -697,7 +702,7 @@ const dest = params.get("destination"); const zone = compute_marc_zone(src, dest); - set_service_zone(zone); + set_service_zone(null, zone); } }