I need to populate some data into a table. The data I have is something I get in response from my ASP.NET MVC site, when I make a JSON post call there. Yet I can't seem to find a way to actually display the data I get back in response. Here is my code so far. Any help would be much appreciated:
$(document).ready(function () {
var uName = '<%= Session["UserName"].ToString()%>';
var pWord = '<%= Session["Password"].ToString()%>';
var data = { UserName:uName,Password:pWord};
$.ajax( {
type: 'POST',
url: "http://someurl.goes.here/",
crossDomain: true,
data: data,
dataType: 'jsonp',
success: function(myData) {
$.each(myData, function (index, element) {
$("#ClassTable").append('<tr><td> ' + element[0] + ' </td> <td> ' + element[1] + '</td></tr>');
})
}
});
});
myData looks like this:
[Object { IsActive = True, ObjectId=1, ObjectString="someString", etc... etc... } ]