I have a recursive jQuery function that has something like this:
parentItem.find('> div:first-child > span.c-checkbox > input[type="checkbox"]');
This runs great in Chrome, Firefox, Safari, and even IE9. With IE8 and below it is horribly slow (15+ seconds).
I found in an article that IE8 performs bad with “find”: http://ethermuse.blogspot.com/2011/07/jquery-find-slow-in-ie8.html. I do not quite understand the concept. Can someone recommend a way to make this work properly in IE8?
EDIT:
I tried replacing the code snippet with this in my application and I think I noticed an improvement:
parentItem.children("div:first-child").children("span.c-checkbox").children("input[type=checkbox]")
Are the selectors identical and is there a way I can measure this?
Try to reduce the number of advanced selectors inside of find().
Try this: