Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

wordpress ajax trigger code

echo '<button id="ZapisPrace">Save</button>
<script>
jQuery("#ZapisPrace").click(function($){
    var data={
        action: "addToDB",
        info: "nomz"
    };
    jQuery.post(ajaxurl,data,function(response){
    alert("Response was "+ response);
    });
});
</script>';
add_action('wp_ajax_addToDB','pridajDoDB');
function pridajDoDB(){
    echo '<script>console.log("AAA")</script>';
    wp_die();
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery clone row 
Javascript :: round to decimal javascript 
Javascript :: how to get last element of array in javascript 
Javascript :: js for 
Javascript :: NODEJS ES6 STRING TO BASE64 
Javascript :: eventemitter in angular 
Javascript :: nodejs read image as base64 
Javascript :: javascript find object array 
Javascript :: send json body http get flutter 
Javascript :: javascript split remove last element 
Javascript :: javascript flatten array of arrays 
Javascript :: decrement operator in javascript 
Javascript :: innertext js 
Javascript :: javascript array findindex 
Javascript :: timeline javascript 
Javascript :: js check if string is int 
Javascript :: socket io query 
Javascript :: short if statements in javascript 
Javascript :: int to string javascript 
Javascript :: iterate through object javascript 
Javascript :: jest debugger node 
Javascript :: The document.getElementById() Method 
Javascript :: JavaScript querySelector - By ID 
Javascript :: window scroll top 
Javascript :: javascript Program for Sum of the digits of a given number 
Javascript :: moment set time 
Javascript :: how to compare arrays in js 
Javascript :: how to get in an object js 
Javascript :: save jshint 
Javascript :: capture keystrokes in javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =