Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery ajax send data to wordpressajax_url not defined

function my_enqueue() {

    wp_enqueue_script( 'ajax-script', get_template_directory_uri() . '/js/my-ajax-script.js', array('jquery') );

    wp_localize_script( 'ajax-script', 'my_ajax_object',
            array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
}
add_action( 'wp_enqueue_scripts', 'my_enqueue' );
Comment

PREVIOUS NEXT
Code Example
Javascript :: arrow function no need for curly braces bc just one action 
Javascript :: javascript array group duplicates 
Javascript :: export data from iredmail 
Javascript :: package json replace to dev dependencies 
Javascript :: web audio complex example 
Javascript :: getting form value(s) with js 
Javascript :: create component with COUNT 
Javascript :: regression line 
Javascript :: change background color js tinymce 
Javascript :: angular dynamic script loading 
Javascript :: find date range btween start date to end date in node js 
Javascript :: json to schema javascript 
Javascript :: tag p is already been closed when there are div tag angular 
Javascript :: how do i count the number of occurrences in a string javascript 
Javascript :: expressions meaning in bengali 
Javascript :: why is javascript the worst programming language 
Javascript :: howler.js play file 
Javascript :: e.addEventListener("input", function(){ e.value?n.innerText="Nama: "+e.value:n.innerText=""; }); 
Javascript :: jaavascript loop array 
Javascript :: javascript format hour 
Javascript :: how to ask for leave in js 
Javascript :: get player on seat 
Javascript :: add position suffix to number in js 
Javascript :: Immediate execution of a function 
Javascript :: how to write text with javascript 
Javascript :: angularjs component stackoverflow 
Javascript :: how to insert image in javascript code 
Javascript :: javascript pdf 
Javascript :: numbers Math 
Javascript :: how to connect terminal with javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =