Ajax : Why success displays 0?

前端 未结 10 1211
生来不讨喜
生来不讨喜 2021-01-01 19:02

I use ajax with jquery and when I tried to display the result in popup. Then alert always displays 0

success : function(results) { 
alert(result         


        
10条回答
  •  南笙
    南笙 (楼主)
    2021-01-01 19:19

    May be you are trying without login. so you need to use this action.

    add_action('wp_ajax_nopriv_my_action', 'my_action_callback');

    you will get response. :)

提交回复
热议问题