Changeset 190


Ignore:
Timestamp:
Oct 26, 2006, 9:36:13 PM (13 years ago)
Author:
David Sheldon
Message:

Don't search if the query is blank, it just returns everything and makes a mess.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r189 r190  
    417417
    418418function find() {
    419    request = 'http://ws.geonames.org/searchJSON?name=' +  encodeURIComponent($('where').value)  + '&callback=getLocation&country=GB&fclass=P&style=SHORT';
    420   aObj = new JSONscriptRequest(request);
    421   // Build the script tag
    422   aObj.buildScriptTag();
    423   // Execute (add) the script tag
    424   aObj.addScriptTag();
     419  var where = $('where').value;
     420  if (where.length > 0) {
     421     request = 'http://ws.geonames.org/searchJSON?name=' +  encodeURIComponent(where)  + '&callback=getLocation&country=GB&fclass=P&style=SHORT';
     422    aObj = new JSONscriptRequest(request);
     423    // Build the script tag
     424    aObj.buildScriptTag();
     425    // Execute (add) the script tag
     426    aObj.addScriptTag();
     427  }
    425428  return false;
    426429}
     
    499502
    500503
     504
Note: See TracChangeset for help on using the changeset viewer.