function countJSONObjByKeyValue(obj, key, value)
{
var countJSONShows = 0;
$.each(obj, function(i, item)
{
if(obj[i].key == value){ countJSONShows++; }
});
alert(countJSONShows);
}
countJSONObjByKeyValue("dashboardJSON.widgets", "show", "false");
is it plausible to think something along the lines there of the function above could work? If so what is wrong with this current function/call to it that I could do to make it work?
I know doing it without the wrapping of a function I can do it just fine but I would like the concept to be reusable.
Should work, however you could also do:
Also note, obj mustnt be passed as a string