2013-12-12 52 views
2

是否有任何jquery函數通過列表中的任何屬性獲取指定數據?在數組中搜索屬性名稱在jQuery中

這是我在頁面中的數組。

[{"ConId":0,"ConCurIdSource":1,"ConCurIdTarget":10,"ConConversionRate":0.27,"IsActive":null,"CreatedBy":null,"CreatedDate":null,"UpdatedBy":null,"UpdatedDate":null,"Abbrivation":"AEDTOPKR"}, 

{"ConId":0,"ConCurIdSource":10,"ConCurIdTarget":1,"ConConversionRate":27,"IsActive":null,"CreatedBy":null,"CreatedDate":null,"UpdatedBy":null,"UpdatedDate":null,"Abbrivation":"PKRTOAED"}, 

{"ConId":0,"ConCurIdSource":10,"ConCurIdTarget":14,"ConConversionRate":101,"IsActive":null,"CreatedBy":null,"CreatedDate":null,"UpdatedBy":null,"UpdatedDate":null,"Abbrivation":"PKRTOUSD"}] 

我需要讓所有MACHING對象Abbrivation

enter image description here

回答

4

無需jQuery的,只需使用標準filter功能:

var matches = myArray.filter(function(v){ return v.Abbrivation==="PKRTOAED" });