[ { "province":"廣東", "item":[ { "ID":"1", "province_id":"7", "title":"廣東小吃 好吃真好吃", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" }, { "ID":"2", "province_id":"7", "title":"廣東炒飯 香噴噴愛上", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" } ] }, { "province":"江西", "item":[ { "ID":"1", "province_id":"8", "title":"江西小吃 好吃不上火", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" }, { "ID":"2", "province_id":"8", "title":"江西炒飯 香噴噴", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" } ] }, { "province":"廣西", "item":[ { "ID":"1", "province_id":"9", "title":"優(yōu)質(zhì)醬鹵牛肉", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" }, { "ID":"2", "province_id":"9", "title":"農(nóng)家自制豆制品豆干豆腐", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" } ] } ]
如上面是ajax獲取到的json數(shù)據(jù),我想要找到title="炒飯"(模糊搜索)所在的對象(符合條件的對象可能不止一個,只要符合都找出來),結(jié)果為:
{ "ID":"2", "province_id":"7", "title":"廣東炒飯 香噴噴愛上", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" }, { "ID":"2", "province_id":"8", "title":"江西炒飯 香噴噴", "imgUrl":"/upload/qa/20221223/20221223141960.jpg", "link":"https://xxxxxxxxx" }
js白癡一枚,求大神指導(dǎo),我能無恥的求一份demo嗎?再不濟也請告訴我一下如何實現(xiàn)的思路好么?還有兩天,做不出來就完蛋了,跪求!