It's currently not so slow as to make the site unusable, but in mobile safari on the iphone there is a noticeable lag. Is there a simpler way to do this?
"Find div.items that have an empty div.video_guid"
It's currently not so slow as to make the site unusable, but in mobile safari on the iphone there is a noticeable lag. Is there a simpler way to do this?
"Find div.items that have an empty div.video_guid"
Are there div's with a class video_guid anywhere else on the page? If not, you could simplify it to:
$('div.video_guid:empty');
The only difference between your selector and mine is that yours would match the parent div.item
while mine would match the actual div.video_guid
. To get around this, once my selector matches, if you want to perform operations to the parent div.item
you could just do:
$('div.video_guid:empty').each(function() {
var container = $(this).parents('div.item');
// do something to the containing div
});
All things considered, I would expect that to perform better..
Read this related question. According to this,
$(‘div.item:has(div.video_guid:empty)’, '#data')
should be faster. Strange, but apparently measurable.