Food + Drink

View all

Health + Wellness

View all

Café + Speciality Food

View all

Artist + Makers

View all

Shopping + Retail

View all

Real Estate + Design

View all

Catering + Event Planning

View all

Pets, Home + Garden

View all

Nonprofits

View all
== 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == 'Near')) jQuery(".snear", $form).val(default_location); geocodeAddress($form); } function doGeolocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(positionSuccess, positionError); } else { positionError(-1); } } function positionError(err) { var msg; switch (err.code) { case err.UNKNOWN_ERROR: msg = "Unable to find your location"; break; case err.PERMISSION_DENINED: msg = "Permission denied in finding your location"; break; case err.POSITION_UNAVAILABLE: msg = "Your location is currently unknown"; break; case err.BREAK: msg = "Attempt to find location took too long"; break; default: msg = "Location detection not supported in browser"; } jQuery('#info').html(msg); } function positionSuccess(position) { var coords = position.coords || position.coordinate || position; jQuery('.sgeo_lat').val(coords.latitude); jQuery('.sgeo_lon').val(coords.longitude); jQuery('.geodir-listing-search').submit(); } /** * On unload page do some cleaning so back button cache does not store these values. */ window.onunload = function(){ if(jQuery('.sgeo_lat').length ){ jQuery('.sgeo_lat').val(''); jQuery('.sgeo_lon').val(''); } };