Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $(document).on( 'click', 'a.mylink', function( event ) {
- $.ajax({
- url: testing.ajax_url,
- data : {
- action : 'diplay_user_table'
- },
- success : function( response ) {
- jQuery('#user_reponse').html( response );
- }
- })
- })
- })(jQuery);
- add_action( 'wp_enqueue_scripts', 'ajax_test_enqueue_scripts' );
- function ajax_test_enqueue_scripts() {
- wp_enqueue_script( 'test', plugins_url( '/test.js', __FILE__ ), array('jquery'), '1.0', true );
- wp_localize_script( 'test', 'testing', array(
- 'ajax_url' => admin_url( 'admin-ajax.php' )
- ));
- }
- add_action('wp_ajax_my_action', 'diplay_user_table');
- function diplay_user_table() {
- echo "function is loading in div";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement