Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ajax post form listener button

$("button").click(function(e) {
    e.preventDefault();
    $.ajax({
        type: "POST",
        url: "/pages/test/",
        data: { 
            id: $(this).val(), // < note use of 'this' here
            access_token: $("#access_token").val() 
        },
        success: function(result) {
            alert('ok');
        },
        error: function(result) {
            alert('error');
        }
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript detect when element is at bottom of screen 
Javascript :: immediately invoked function expression 
Javascript :: React tagInput component 
Javascript :: puppeteer wait for page loadjavascript 
Javascript :: js binary search 
Javascript :: react big calendar event color 
Javascript :: javascript cartesian product 
Javascript :: javascript NEGATIVE_INFINITY 
Javascript :: @paypal/react-paypal-js 
Javascript :: DataTables warning: table id=example-dt - Invalid JSON response. 
Javascript :: javascript hide elements by class 
Javascript :: javascript copy array 
Javascript :: how to pass state from one component to another in functional component 
Javascript :: javascript onclick append a new row to table 
Javascript :: fetch request 
Javascript :: loops in javascript 
Javascript :: list keys json python 
Javascript :: Hide angular element on button click 
Javascript :: faker js 
Javascript :: can we call ajax inside ajax success 
Javascript :: react grid 
Javascript :: execcommand javascript 
Javascript :: vscode react extensions 
Javascript :: remove item from array javascript 
Javascript :: eliminar comillas de un string javascript 
Javascript :: mongoose number bigger 
Javascript :: check if variable is set javascript 
Javascript :: react key press hook 
Javascript :: node sudo nvm 
Javascript :: how to include js file in react 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =