Hi Everyone,
I'm trying to display Json data on my JQuery datatable. The json data is on remote server, if the json data is on my server then i'm able to fetch and display the data on my datatable but i can't able to fetch the json data from a remote server . How can i get the json data from a remote server? . Following is my sample code.
This is the URL('http://xxx.xxx.xxx:8088/test/validGetMyApplications.json'; , on a remote 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.
Any suggestions please. Thanks.
<script type="text/javascript">
$(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.Id,
item.appLink.linkName,
item.applicationIdName.applicationName,
item.appAcronym,
item.applicationOwner.name
]
);
});
}
});
} );
</script>
I'm trying to display Json data on my JQuery datatable. The json data is on remote server, if the json data is on my server then i'm able to fetch and display the data on my datatable but i can't able to fetch the json data from a remote server . How can i get the json data from a remote server? . Following is my sample code.
This is the URL('http://xxx.xxx.xxx:8088/test/validGetMyApplications.json'; , on a remote 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.
Any suggestions please. Thanks.
<script type="text/javascript">
$(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.Id,
item.appLink.linkName,
item.applicationIdName.applicationName,
item.appAcronym,
item.applicationOwner.name
]
);
});
}
});
} );
</script>