AnsweredAssumed Answered

If/else loop on for statement for results from query

Question asked by Arkitech on Oct 24, 2013
Latest reply on Oct 25, 2013 by Arkitech
Hi all

Im struggling with a if/else statement on a for loop for the results from a querytask...

  function showResults(results) {           var s = "";           for (var i=0, il=results.features.length; i<il; i++) {             var featureAttributes = results.features[i].attributes;             for (att in featureAttributes) {               s = s + "<b>" + att + ":</b>  " + featureAttributes[att] + "<br>";             }             s = s + "<br>";           }           dom.byId("info").innerHTML = s;         }       });

im trying to target the features length ==1 or ==0  as i can work with both but im getting no luck! which is strange as i have never had a problem with such a simple task.

Any ideas?