0

i have json file which is hosted on the server. this is the link.

http://jsonji.azurewebsites.net/json1.json,

and i am able to get json data when this file is on the my local system. this is the code

$(document).ready(function () {
    $.getJSON("http://jsonji.azurewebsites.net/json1.json",
    function (data) {
        $.each(data.person, function () {
            $("ul").append("<li> Name:" + this['name'] + "</li><li>Age" + this['age'] + "</li><br/>");
        });
    });
});

if you know then please help me

Gaurav Mantri
  • 100,555
  • 11
  • 158
  • 192
user3086954
  • 11
  • 1
  • 5

1 Answers1

1

The reason you're not able to read this JSON file is because you're browser is trying to make a cross-domain request and most likely CORS Setting is not enabled on your website.

See this thread for more details: HTTP OPTIONS request on Azure Websites fails due to CORS.

Community
  • 1
  • 1
Gaurav Mantri
  • 100,555
  • 11
  • 158
  • 192