Created
March 7, 2021 16:11
-
-
Save alanef/418853b17e7fdf13c12c9ffe14b2a9a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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