How to Hit a URL to pull out the json data and to display the data on DataTable using ajax calls.

How to Hit a URL to pull out the json data and to display the data on DataTable using ajax calls.

srikanthreddysrikanthreddy Posts: 7Questions: 0Answers: 0
edited June 2013 in Blog
Hello Everyone,

This URL('http://xxx.xxx.xxx:8088/test/validGetMyApplications.json' , got from a different server ) is having my JSON object, i'm trying to hit this URL and trying to pull the json data from this URL to display this data in Jquery Datatable.
but, when i'm trying with this following code it is not hitting the URL. Is anyone can suggest me something to resolve this issue please. Your suggestions will be very helpful. Thanks.


$(document).ready(function() {
$('#myapplicationstable').dataTable();
$.ajax({
url: 'http://xxx.xxx.xxx:8088/test/validGetMyApplications.json',
async: false,
dataType: 'json',
success: function (data) {
$.each(data.applicationMainList, function(key, item) {
$('#myapplicationstable').dataTable().fnAddData( [
item.motsId,
item.prismAppLink.linkName,
item.applicationIdName.applicationName,
item.appAcronym,
item.applicationOwner.name
]
);
});
}
});

} );
This discussion has been closed.