Hi!
How do I find out which "count"-id the loaded picture has?
The loaded picture is: "df5ddc27f7569f83e3867bec71a2cac0.jpg"
And my json are:
[
{"count":1,"file":"8b6c5592f0378dc8c56e591a7b147826.jpg"},
{"count":2,"file":"a44618c1afe93be486382ceb38536e02.jpg"},
{"count":3,"file":"3c692942d69fba0d16971e0685f42757.jpg"},
{"count":4,"file":"df5ddc27f7569f83e3867bec71a2cac0.jpg"}
]
Has anybody an idea for me?
Thanks in advance!
AVADHESH PATEL
12-Mar-2013Hi Mark!
I assume that you are trying to do this with JavaScript
var jsondata = [
{"count":1,"file":"8b6c5592f0378dc8c56e591a7b147826.jpg"},
{"count":2,"file":"a44618c1afe93be486382ceb38536e02.jpg"},
{"count":3,"file":"3c692942d69fba0d16971e0685f42757.jpg"},
{"count":4,"file":"df5ddc27f7569f83e3867bec71a2cac0.jpg"}
];
function getId(file) {
for(var f in jsondata) {
if(jsondata[f].file == file)
return jsondata[f].count;
}
}
var id = getId("df5ddc27f7569f83e3867bec71a2cac0.jpg"); //count-id