wp_localize_script ajax url working with example tutorial in wordpress
wp_localize_script usage and exception handling
/* Enqueue script and Localize */
function my_scripts(){
wp_enqueue_script("custom-script", get_stylesheet_directory_uri()."/custom.js", array('jquery'));
wp_localize_script( 'custom-script', 'myajax', array('ajaxurl' => admin_url( 'admin-ajax.php' )) );
}
add_action("wp_enqueue_scripts","my_scripts");
wp_localize_script tutorial: Simple example in wordpress
wp_localize_script json : How it works
wp_localize_script not defined: why we come up with not defined error
wp_localize_script not working: Here can be possible causes
what does wp_localize_script do: What is the use of function
Read more from Amitpal Singh