How to determine if a Post contains a specific Category in a JSONP feed using jQuery?
问题 I need to detect if a post contains a specific category from a JSONP feed. I'm not sure how to read the array as it's currently saying it's null. The link works without any problems though, which is just a string. $.jsonp({ url : "theurl", dataType : "jsonp", timeout : 10000, success : myFunction, error : myErrorFunction }); function myFunction (data) { $.each(data, function(i, post){ var link = post.permalink, hasCategory = $.inArray("specialcategory", post.categories); }); } Here's an