Thanks! I now did this, which also works:
var url = dhis_api_base +'organisationUnits.json?userDataViewFallback=true'; $.getJSON( url, function( json ) { console.dir(json.organisationUnits[0].name + ' has UID ' + json.organisationUnits[0].id); }); On Wed, Jun 11, 2014 at 9:03 AM, Morten Olav Hansen <morte...@gmail.com> wrote: > > On Wed, Jun 11, 2014 at 8:50 AM, Knut Staring <knu...@gmail.com> wrote: > >> $.getJSON( url, function( json ) { >> console.dir(json); >> }); >> > > $.ajax({ > url: URL, > dataType: 'json' > }).done(function(data) { > $.each(data.organisationUnits, function(idx) { > console.log("root" + idx + ": " + this.id); > }) > }); > > Something like that could work, it returns an array of orgUnits > > -- > Morten > -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp