Plugin ajax call to wp-ajax.php in admin page returning 0
-
My code is:
jQuery.ajax({ url: "<?php echo admin_url('admin-ajax.php'); ?>", type: 'POST', data: { action: 'stravyfuncajax' }, dataType: 'html', success: function(response) { alert(response); }
add_action('wp_ajax_stravyfuncajax', 'testfunc11'); add_action('wp_ajax_nopriv_stravyfuncajax', 'testfunc11'); function testfunc11() { echo "2"; die(); }
Please help. Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin ajax call to wp-ajax.php in admin page returning 0’ is closed to new replies.