You’re not hooking the function to wp_ajax correctly. You need to replace the my_action
part with your action name that you’re using the in AJAX request. In your case it’s display_user_table
. You also need to hook it on to wp_ajax_nopriv
so that it works for logged out users. Here’s your hook with those changes:
add_action('wp_ajax_diplay_user_table', 'diplay_user_table');
add_action('wp_ajax_nopriv_diplay_user_table', 'diplay_user_table');
function diplay_user_table() {
echo "function is loading in div";
wp_die();
}
Related Posts:
- AJAX handler throws 400 (Bad request) – why?
- ajax live search for post title
- 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 call does not work for this custom code
- AJAX values converted to PHP Variables?
- iOS and ajaxComplete
- Ajax call always returns 0
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- Use AJAX in shortcode
- Apply jquery script to only woocommerce product pages and categories
- Replacing select2 in admin backend for all selects
- How to save Uploaded image in custom option panel?
- How can I rename the WordPress AJAX URL? [duplicate]
- How do I call wp_mail from HTML?
- Add external js file to footer with id
- Click loads template via ajax
- Search user metadata with checkboxes via ajax (almost working)
- WordPress doesn’t Load JQuery Now? Do I need to enqueue JQuery also?
- How to speed up admin-ajax.php in wordpress
- Replace menu links with # and add name to its li
- Loading CDN that requires jQuery in WordPress
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Right way to update widget on dynamic new input field
- Wp_query function to search from product_title ‘OR’ product tags name
- how to search users by ajax live search
- How to change the order of Jquery in the footer of my theme?
- How to know which ajax file or function is called for action
- Jquery implementation not working on page reload
- Multisite Ajax serialize return error [object Object]
- Attempt to change jQuery version caused White Screen of Death
- Create post using Ajax
- PHP mixed with some JS code to update WordPress theme settings
- Load jquery only for certain pages in the backend
- WordPress listen to $_POST in functions.php
- Add a jQuery Function
- Load Post into DIV with Ajax
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- AJAX error handling for submit function in functions file
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Function won’t run onclick using Ajax
- PHP 7.1 | Warning: A non-numeric value encountered in
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Loading two different AJAX requests on two different pages
- WordPress notification if new post published
- Why i can’t get custom fields value or post ID via Ajax?
- processing form data with ajax
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Passing Jquery value to WordPress function
- Email Exists ERROR into Ajax registration form
- How to use get_posts() function in functions.php
- Ajax resetting my global variable
- colorbox not loading in
- How to add php within jquery
- Database entry removed on browser refresh, Ajax PHP jQuery
- Detect Ajax call inside pre_get_posts function
- Cannot pass value variable to WP AJAX functions
- WordPress does not load jQuery
- WP AJAX Request Not Working
- Ajax in plugin fails – but only on one blog – no idea why
- WordPress Ajax not returning Response
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- How to call a function from functions.php with ajax?
- Function stops working
- admin-ajax.php 403 forbidden only when calling from external file
- How do i create a search option for pdf’s only
- Execute jQuery with custom event listener after successfully add an item to the cart
- Find the method which AJAX GET calls
- How to create admin ajax function for my contact form
- admin-ajax.php & my wp-admin folder url showing in header
- wordpress function through ajax not being called
- wordpress ajax is not working for dropdown selection
- Moving CDN jQuery to footer does not work?
- Pass max posts to Javascript
- Updating site content after an AJAX call without a page reload
- Error function main() is a non-object to construct my Ajax.php
- jQuery HoverIntent is not a function
- Pass jquery var to a function in functions.php
- ajax form function error
- Owl Carousel and WordPress Integration Via WP_Enqueue
- Animated Accordion [closed]
- get page_id in ajax to function in functions.php