Created
June 5, 2019 00:55
-
-
Save mikeoberdick/15bf1b90812d71d85532cd064f279013 to your computer and use it in GitHub Desktop.
Creates a drop down that can be used to filter posts per page
This file contains 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
$('#tax-filter').change(function() { | |
var filter = $('#tax-filter'); | |
$.ajax({ | |
url:filter.attr('action'), | |
data:filter.serialize(), | |
type:filter.attr('method'), | |
beforeSend:function(xhr){ | |
$('#spinner').toggle(); | |
}, | |
success:function(data){ | |
$('#spinner').toggle(); | |
$('#sortedPosts').html(data); | |
} | |
}); | |
//debug -> console.log(filter.attr('method')); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment