I am using an accordion to which I add three items. The third item gets it’s content from a call to attachURL(url) and the iframe is loaded successfully and I can see it’s content in the DOM. Unfortunately when I try to access any of the HTML elements within the iframe I get a null value. The code follows:
accordion.cells(“b3”).attachURL(url);
var iFrameObj = subAccordion.cells(“b3”).getFrame();
var iframe = iFrameObj.contentWindow;
var findMe = iframe.document.getElementById(“findMe”);
The findMe variable is always null. If I print the iframe object to the console it looks like an iframe, but it’s #document property is empty, even though it is visible in the DOM.
I’m thinking the attachURL(url) code is running asynchronously so the content is not yet available, however I’ve tried telling it not to use ajax:
accordion.cells(“a2”).attachURL(url, false);
but that didn’t work either. I’ve tried to see if there is a “onContentLoaded” or some such event handler for an accordion, but so far haven’t found anything.