whenever i use jquery ajax for get and post then i wrote the code as follows
$(document).ready(function () {
$.ajax({
type: "POST",
url: "MyPage.aspx/ProcessInfo",
data: JSON.stringify(DTO),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {}
});
so i need to know that how could i write a generic routine for jquery ajax call where i can pass request type call GET/POST, URL, DATA TYPE, and DATA. data could be in json format or may be like two or three augument. so help me with concept by which i can write generic routine which i can use in any situation for ajax call. where data type is json or not. thanks