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
- wp_get_attachment_image returns different image size
- 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?
- Display random text from a file with the WP built-in AJAX API
- Using email_exists() wp function in an ajax request
- How can I rename the WordPress AJAX URL? [duplicate]
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- jQuery plugin function is not a function
- What’s the point of using WordPress’s built in admin-ajax.php?
- Enqueuing Script in functions.php vs on the page
- How do I call wp_mail from HTML?
- Add external js file to footer with id
- Click loads template via ajax
- How to load some jquery code to make validation in the theme customizer?
- Search user metadata with checkboxes via ajax (almost working)
- Move jQuery and Migrate to footer?
- jQuery Plugin to use WordPress functions in AJAX request
- Ajax call theme functions from front
- jquery won’t load in footer
- WordPress doesn’t Load JQuery Now? Do I need to enqueue JQuery also?
- How to speed up admin-ajax.php in wordpress
- 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
- 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
- How to load jQuery in the footer – nothing works for me
- Function call via ajax – can’t figure it out?
- Not sure if enqueuing js scripts properly
- Wp_query function to search from product_title ‘OR’ product tags name
- Allow Post Author to be 0 on Update
- how to search users by ajax live search
- 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 know which ajax file or function is called for action
- how to en-queue jQuery to load before the tag
- Jquery implementation not working on page reload
- Multisite Ajax serialize return error [object Object]
- I can’t enqueue my scripts – They literally aren’t being added to my site
- 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
- How to disable controls in theme customizer?
- Load jquery only for certain pages in the backend
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- WordPress listen to $_POST in functions.php
- Add a jQuery Function
- jQuery does not work
- using jQuery on only one page
- Load Post into DIV with Ajax
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Can’t call Javascript function – scope?
- AJAX error handling for submit function in functions file
- Changing parent element’s class or style
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- 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?
- How can i unload effect.min.js file?
- 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