Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var geoSearch = new google.maps.Geocoder;
- jQuery(document).ready(function() {
- var address = FYN_search.postcode;
- if(jQuery.type( address ) === "string"){
- var region = 'Austria';
- address = address + ', ' + region;
- geoSearch.geocode({'address':address,'region':region},function(results, status){
- if (status == google.maps.GeocoderStatus.OK) {
- var point = results[0].geometry.location;
- var data={
- action:'filter_search',
- lat:point.lat(),
- lng:point.lng()
- }
- jQuery.post(FYN_search.ajaxurl, data, function(returndata){
- console.log('ajax posting');
- jQuery('#resulit').html(returndata);
- });
- } else {
- alert("Geocode was not successful for the following reason: " + status);
- }
- });
- }
- });
- add_action('wp_ajax_filter_search', 'filter_search_result');
- function filter_search_result(){
- echo 'hello world';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement