Skip to content

Instantly share code, notes, and snippets.

@ubergoober
Created May 7, 2014 18:26
Show Gist options
  • Save ubergoober/9c783411cbf184dd6eba to your computer and use it in GitHub Desktop.
Save ubergoober/9c783411cbf184dd6eba to your computer and use it in GitHub Desktop.
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
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment