私はJsonオブジェクト配列を持っています
posturlContent = [
{ "Title": "Bbc news live", "Content": "<div>this is a test BBC </div>", "Uri": "http://bbc.co.uk" },
{ "Title": "CNN news live", "Content": "<div>this is a test CNN</div>", "Uri": "http://cnn.com" },
{ "Title": "Youtube news live", "Content": "<div>this is a test Youtube </div>", "Uri": "http://youtube.com" },
];
私はJS配列を持っています
uris =["http://cnn.com", "http://abcnews.com",...]
URIにあるアイテムのみのposturlContentの出力が必要なので、以下に示します。
posturlContent = [
{ "Title": "CNN news live", "Content": "<div>this is a test CNN</div>", "Uri": "http://cnn.com" }
];
これを使用してみましたが、空の posturlContent が返されました
$.each(uris, function(){
var siteUrl = this.valueOf();
posturlContent = $.grep(posturlContent, function(item){
return item.Uri.toLowerCase() != siteUrl.toLowerCase();
});
})