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 General
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
]
);
});
}
});

} );

Replies

  • aaronwaaronw Posts: 89Questions: 3Answers: 4
    So due to cross site scripting and same origin policy you can't just .load any file you want. Look at http://stackoverflow.com/questions/8973672/jquery-load-content-from-a-remote-site for some examples
  • srikanthreddysrikanthreddy Posts: 7Questions: 0Answers: 0
    Hi aaron, thanks a lot for response, and i will give a try.
This discussion has been closed.