keithclark/selectivizr — Issue #24: ContentLoaded fires too soon when inside iframe
Author: gxclarke
Created: 2011-10-27 14:58:41+00:00
State: open

This issue only occurs for a page within an iframe. It was tested with IE7 and IE8 using jQuery.

The DOM is not ready when applyPatches runs, so selectorMethods always returns an empty list. To validate this I added the following code to the beginning of applyPatches():

var testSelector = ".layout-fluid-sidebar > .col:first-child";
log(jQuery(testSelector).length);
jQuery(function () {
log(jQuery(testSelector).length);
});

The first value logged is 0 while the second value is 1. There is nothing special about this particular selector. The same behavior occurs no matter which one is tested.

If I open the same page directly rather than from within an iframe, both logged values are 1.