function getData() { var $tbl = $('#tblJobInfo'); $.ajax({ url: 'GridScore.aspx/JobDataTest', type: 'POST', contentType: "application/json; charset=utf-8", data: "{}", datatype: 'json', async: true, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Request: " + XMLHttpRequest.toString() + "\n\nStatus: " + textStatus + "\n\nError: " + errorThrown); }, success: function (data) { debugger; alert("x"); var abcStr = data.d; var valSplit = abcStr.split('-'); alert(valSplit); $tbl.empty(); $tbl.append('<table><tbody><tr><th>Job Title</th><th>Published Date</th><th>Expiry Date</th><th>Job Status</th></tr></tbody></table>'); var rows = []; //for(var i = 0; i < data.d.length; i++) { //rows.push(' <table><tbody><tr><td>' + data.d[i].JobTitle + '</td><td>' + data.d[i].PublishedDate + '</td><td>' + data.d.[i].ExpiryDate + '</td><td>' + data.d.[i].JobStatus + '</td></tr></tbody></table>'); rows.push(' <table><tbody><tr><td>' + "Asp.Net" + '</td><td>' + "06/11/2014" + '</td><td>' + "06/11/2014" + '</td><td>' + "Approved" + '</td></tr></tbody></table>'); alert(rows); //} $tbl.append(rows.join('')); } }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)