1
I download a JSON file, by example, saved and then open (all this by javascript), and want to access the Property 'Has_infobox_html', I tried to use the following loop
var poeItem = new function() {
this._getHTMLdata = function(fileData) {
for (i = 0; i = fileData.query.data.length; i++); {
if (fileData.query.data[i] && fileData.query.data[i].property == 'Has_infobox_HTML') {
return fileData.query.data[i].dataitem[0].item
}
}
}
}
However it does not return anything, I tried to print the 'i’s and it seems to test only for 0 and then for, I have tested the other parts of the code and they work normally, the problem seems to be in this specific part
what you want to return? take care that when the
if
dertrue
thereturn
is breaking thefor
– guijob