VIEWER SIDE AJAX not working!!!
-
i really cant figure out why ajax is not working. here is the code I implemented.
for the j-query function (which is loading up corrrectly in my header):
function changeClass() { $j=jQuery.noConflict(); $j.ajax({ type: "POST",url:"/wp-admin/admin-ajax.php",data:{action:'comment_change_type'}, success: function(results){ alert(results); } }); }
and for my php callback function:
function change_comment_type(){ echo "OK!"; die(); } add_action('wp_ajax_comment_change_type', 'change_comment_type'); add_action('wp_ajax_nopriv_comment_change_type', 'change_comment_type');
any ideas? i am all out of ’em.
- The topic ‘VIEWER SIDE AJAX not working!!!’ is closed to new replies.