Widget:PillIdentifier: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 166: | Line 166: | ||
someData=data; | someData=data; | ||
someResults=data.query.results; | someResults=data.query.results; | ||
if(data | console.log(countProperties(data.query.results)); | ||
if(countProperties(data.query.results) > 0){ | |||
$.each(data.query.results, function(ind, val) { | $.each(data.query.results, function(ind, val) { | ||
///////////////////////////////////////////////////////////////////////// | ///////////////////////////////////////////////////////////////////////// | ||
Line 363: | Line 364: | ||
} | } | ||
}; | }; | ||
function countProperties (obj) { | |||
var count = 0; | |||
for (var property in obj) { | |||
if (Object.prototype.hasOwnProperty.call(obj, property)) { | |||
count++; | |||
} | |||
} | |||
return count; | |||
} | |||
</script> | </script> | ||
<style type="text/css"> | <style type="text/css"> |