Trying to run the following code
var superGroup = $.parseJSON(data);
$.each(superGroup, function(idx, obj) {
if (idx.contains("Addr_Line")) {
if (obj != null) {
currentAddress.push(obj);
}
}
});
Where supergroup is a JSON object with a bunch of properties and I basically only want to add the values of the properties in this object which contain "addr_line". In chrome I noticed there is a JS error on
idx.contains()
Saying idx does not contain a method contains
Any idea how I can get around this ?
idxwill either be a string or a number. Neither of which have a.contains()method. EDIT:String.contains()exists, but nothing (except Firefox) supports it.