Instead of doing:
data: {action: 'performers', catname: catname}
Try:
data: 'action=performers&catname="+catname;
You may also want to define “catname” globally, i am not sure if scope is an issue with your ajax handler but this could be why it is not being set. As an example try to alert catname within the ajax handler above cache=false; if the alert is not thrown then catname is not set.
Instead of using alerts which can become tedious you could use console.log(catname) and review the value within the console.
In relation to using nonce for security e.t.c I can”t help you there, I am sure there are a plethora of articles out there explaining its use. google it. check out the wordpress codex to.
Hope this helps.
Related Posts:
- AJAX handler throws 400 (Bad request) – why?
- ajax live search for post title
- Display a function using AJAX
- Unable to get_the_content(); of a post in WordPress via AJAX
- Ajaxing function in widget class
- woocommerce target button with class after ajax update
- WP Ajax Function Always Returning undefined
- Scripts not appending to element in AJAX call – why?
- How to search using ajax for exact phrase or words in an input field?
- echo custom fields with AJAX
- Are innerHTML elements visible to jQuery functions?
- get content from page through AJAX
- Get URLs for AJAX Filter Checkboxes WordPress
- Populate Product Regular Price with a calculated ACF Field Value
- Ajax Form Issues using Lightsail (AWS)
- post value to function with Ajax and jQuery
- How to use `foreach()` in ajax call
- Multiple Notifications SetInterval
- WordPress Ajaxifying not working properly
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- Automatic add space if user enters number(any digit)
- AJAX values converted to PHP Variables?
- iOS and ajaxComplete
- Ajax call always returns 0
- wp_get_attachment_image returns different image size
- Display random text from a file with the WP built-in AJAX API
- Using email_exists() wp function in an ajax request
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- Click loads template via ajax
- jQuery Plugin to use WordPress functions in AJAX request
- Ajax call theme functions from front
- jquery won’t load in footer
- Woocommerce checkout field maxlength, make input number field only (postcode)
- ‘is’ functions and ‘get_query_var’ not working
- Replace menu links with # and add name to its li
- Ajax not working properly
- How to load jQuery in the footer – nothing works for me
- Wp_query function to search from product_title ‘OR’ product tags name
- Allow Post Author to be 0 on Update
- Trouble with adding a wp_enqueue_script on wordpress
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Search filter by Post title OR Meta Title Value [duplicate]
- dynamic dependent select dropdown
- How to change the order of Jquery in the footer of my theme?
- admin-ajax.php + load-scripts.php hanging for minutes
- how to en-queue jQuery to load before the tag
- Attempt to change jQuery version caused White Screen of Death
- How to disable controls in theme customizer?
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- Add a jQuery Function
- jQuery does not work
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Function won’t run onclick using Ajax
- In jquery use php variable to execute an enqueued jquery file
- Run a jquery script on on a certain template page
- Add php code to wp_print_scripts?
- PHP 7.1 | Warning: A non-numeric value encountered in
- Loading two different AJAX requests on two different pages
- WordPress notification if new post published
- Check if a value exists in database table
- Where is this JQuery coming from?
- How to load jQuery in TOP of wp_footer?
- Add loggedout class on body using a function or JS
- How to use get_posts() function in functions.php
- Include Jquery libraries in wordpress theme?
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Execute Jquery when a specific page in my plugin is loading
- Creating multiple category drop down
- How to add php within jquery
- Help with IF has focus then… statment
- Ajax filter with loadmore button
- Hide ‘add to cart’ when certain value in dropdown is selected
- Cannot pass value variable to WP AJAX functions
- Update $wpdb query with AJAX
- Finding post ID dynamically on click
- Images with overlay
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Find the method which AJAX GET calls
- WordPress Jquery+scripts enqueue issue
- Moving CDN jQuery to footer does not work?
- Adding a jQuery rotator function
- functions.php filters not applied in AJAX call
- Pass max posts to Javascript
- Why are some custom javascript files working but some are not
- How to use different jquery function of idangero swiper dependant on page template?
- admin-ajax.php nulls all php variables
- Pass jquery var to a function in functions.php
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- How do I get my nav menu to show sub pages?
- Having problems loading Jquery in functions.php
- Why wp_ajax hooks doesn’t work?
- AJAX: WordPress filters inside $html do not work as intended
- WordPress Custom wp mail template return full template
- Animated Accordion [closed]
- get page_id in ajax to function in functions.php
- How to get variable from other function inside class function using add_action for Ajax call