Recover json through a url using ajax

Asked

Viewed 77 times

0

I have this method that searches the data that is in a txt file and populates a table:

$(document).ready(function () {
    $('#example').DataTable({
        "ajax": "objects.txt",
        "columns": [
            { "data": "name" },
            { "data": "position" },
            { "data": "office" },
            { "data": "extn" },
            { "data": "start_date" },
            { "data": "salary" }
        ]
    });
});

How can I modify this method to search for a url, which returns a json?

that is the url: http://localhost:55959/Client/getBydesc

  • Search for what? Your question is not very clear. Click [Edit] and add more details.

  • Have you tested "ajax": "http://localhost:55959/Cliente/getBydesc", ?

  • Diego, this url returns a json

  • Substitute objects.txt with the URL you want

  • it worked, I did as Sergio and Giacarlo suggested and it worked cool, hug

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.