My problem is: I made an AJAX call using this code
wp_enqueue_script( 'prefix-myscript-name', plugins_url( 'js/ajaxcall.js', __FILE__ ) );
I made the call and the AJAX just going fine. I used this code:
add_action( 'wp_ajax_ajax_action', 'ajax_response' );
add_action( 'wp_ajax_nopriv_ajax_action', 'ajax_response' );
function ajax_response(){
wp_enqueue_script( 'prefix-myscript-call', plugins_url( 'js/myscript.js', __FILE__ ) );
}
I used an alert('Test')
in ajaxcall.js
but it’s not showing up!
I’m disappointed. Any Solution?