Good day! My data is in .json format. How, with the help of ajax
, could it be displayed in html
table?
So prompted to make an output to the console $ (function () {
var ReqHelper = new Object({ timeout: 120000, postJsonOnServiceAndCallback: function (url, method, params, async, func) { $.ajax({ type: "POST", url: url + method, data: "{ args:'" + JSON.stringify(params) + "'}", timeout: ReqHelper.timeout, contentType: "application/json; charset=utf-8", dataType: "json", async: async, success: function (data) { func(JSON.parse(data.d)); }, error: function (data) { console.log(data); } }); }, getJsonOnServiceAndCallback: function (url, method, params, async, func) { $.ajax({ type: "GET", url: url + method, data: { 'args': JSON.stringify(params) }, timeout: ReqHelper.timeout, async: async, success: function (result) { var xdata = result.querySelector("string").innerHTML; var data = JSON.parse(xdata); func(data); }, error: function (result) { console.log(result); } }); } }); ReqHelper.postJsonOnServiceAndCallback("../csharp/Request4Helper.asmx/", "Helper", {}, true, function (data) { console.log(data); }) });