Skip to content

Instantly share code, notes, and snippets.

@alanef
Created March 7, 2021 16:11
Show Gist options
  • Select an option

  • Save alanef/418853b17e7fdf13c12c9ffe14b2a9a0 to your computer and use it in GitHub Desktop.

Select an option

Save alanef/418853b17e7fdf13c12c9ffe14b2a9a0 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function ($) {
// as nothing will be on the page we initialise with a call
ajax_call();
// on click of the search button we make the call with the filter value
$('#ajaxwfeasearch').click(function () {
ajax_call();
});
function ajax_call() {
$.ajax({
url: test.ajax_url,
type: 'post',
data: {
action: 'test_wfea',
filter: $('#ajaxwfeafilter').val(),
},
success: function (response) {
$('div#ajaxwfea').html(response);
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment