Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_category_name(category) {
- // We'll pass this variable to the PHP function seo_ajax_request
- // This does the ajax request
- var cat_slug = category;
- jQuery.ajax({
- url: seo_ajax_obj.ajaxurl, // or example_ajax_obj.ajaxurl if using on frontend
- data: {
- 'action': 'seo_ajax_request',
- 'category' : cat_slug
- },
- success:function(data) {
- // This outputs the result of the ajax request
- console.log(JSON.parse(data));
- return JSON.parse(data);
- },
- error: function(errorThrown){
- console.log(errorThrown);
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement