“Ajax -Syntax in JavaScript” Code-Antworten

Ajax exmaple

$.ajax({
    url:'your url',
    type: 'POST',  // http method
    data: { myData: 'This is my data.' },  // data to submit
    success: function (data, status, xhr) { // after success your get data
        $('p').append('status: ' + status + ', data: ' + data);
    },
    error: function (jqXhr, textStatus, errorMessage) { // if any error come then 
            $('p').append('Error' + errorMessage);
    }
});
Disturbed Dog

Ajax -Syntax in JavaScript

var id = empid;

$.ajax({
    type: "POST",
    url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
    data: "{empid: " + empid + "}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(result){
        alert(result.d);
        console.log(result);
    }
});
Mysterious Girl

Ähnliche Antworten wie “Ajax -Syntax in JavaScript”

Fragen ähnlich wie “Ajax -Syntax in JavaScript”

Weitere verwandte Antworten zu “Ajax -Syntax in JavaScript” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen