Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

send json post ajax javascript

$.ajax({
    url: 'users.php',
    dataType: 'json',
    type: 'post',
    contentType: 'application/json',
    data: JSON.stringify( { "first-name": $('#first-name').val(), "last-name": $('#last-name').val() } ),
    processData: false,
    success: function( data, textStatus, jQxhr ){
        $('#response pre').html( JSON.stringify( data ) );
    },
    error: function( jqXhr, textStatus, errorThrown ){
        console.log( errorThrown );
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react index.js file 
Javascript :: update node.js dependencies 
Javascript :: moment get tomorrow date 
Javascript :: how to find number in string js 
Javascript :: react native textInput numbers only 
Javascript :: Finished. Please run Mix again. 
Javascript :: Uncaught ReferenceError: jsPDF is not defined 
Javascript :: change src of iframe jquery 
Javascript :: javascript hex to rgb 
Javascript :: javascript get all cookies 
Javascript :: You seem to not be depending on "@angular/core" and/or "rxjs". This is an error. 
Javascript :: jquery click add class 
Javascript :: js loop through array backwards 
Javascript :: javacsript update text in span 
Javascript :: disable inputetext in react native 
Javascript :: javascript uppercase first letter 
Javascript :: pick random string from array javascript 
Javascript :: change background image with jquery 
Javascript :: jquery ajax basic authentication 
Javascript :: jquery submit form ajax 
Javascript :: jquery checkbox is checked 
Javascript :: intval js 
Javascript :: vanilla js delete element 
Javascript :: react native navigation transparent header 
Javascript :: This error occurred during the build time and cannot be dismissed. 
Javascript :: react start new app 
Javascript :: puppeteer get html 
Javascript :: javascript get weekday name 
Javascript :: javascript get attribute 
Javascript :: javascript get scroll position 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =