ubergoob
5/7/2014 - 6:26 PM

jQuery Ajax call to ASP.NET Services simple example

jQuery Ajax call to ASP.NET Services simple example

function My_jQuery_AjaxCall_To_ASPServices_Example() {

$.ajax({
        url: 'HTTP://WEBPAGE.URL/AJAXSERVICE',
        dataType: 'json',
        data: JSON.stringify({PARAM1: "STRINGVALUE", PARAM2: INTVALUE}),
        type: 'post',
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $('#DIVWITHIDNAMETOUPDATE').html(data.d);
            console.log(data.d); // just for visual confirmation in log incase div didn't update
        }
    });
}