Unable to render Datatable from JSON hosted on url

Unable to render Datatable from JSON hosted on url

robgramerobgrame Posts: 2Questions: 0Answers: 0

Hi all,

I'm reaching you out as I'm trying to render in the form of a table some data in the form of a json file hosted on a remote URL.
Though the actual data is different, I have the same exact issue either with some sample data .

Despite I'm able to render correctly the table on my dev environment, whenever I test the web page on the web server keeps reporting Loading status.

Even though I've followed the documentation and guidelines I'm sure I'm still missing some configuration.

This is the script block loading the JSON file

<script type="text/javascript">
$(document).ready(function() {
    $('#empTable').dataTable({
        "ajax": {
            url:"https://securesajson.blob.core.windows.net/jsonrepository/empdata.json",
            "dataType": "json"
        },              
        "columns": [
            {"data": "name"},
            {"data": "designation"},
            {"data": "office"},
            {"data": "extension"},
            {"data": "joining_date"},
            {"data": "salary"}
        ]
    });   
});
</script>

Any help is very appreciated

roberto

Replies

Sign In or Register to comment.