AnsweredAssumed Answered

reading and parsing json data from url

Question asked by veena@hosur on Jan 26, 2016

HI...

 

i am using below code to read and parse json data from URL.But its displying empty info.

can any know give me solution

 

  esri.request({ 

                url:baseURL,  

                content:{f:"json"}, 

                callbackParamName:"callback", 

                load:getServiceDetails,  

                error:esriConfig.defaults.io.errorHandler 

            }); 

         

       

            function getServiceDetails(response, args) {

                alert(response);

                var info = [];

                dojo.forEach(response.folders, function (folder) {

                    info.push("Folder: " + folder + "<br/>");

                });

                dojo.forEach(response.services, function (service) {

                    info.push("Service Details: " + service.name + " " + service.type + "<br/>");

 

 

                });

                console.log(info);

}

Outcomes