i have an iframe and in javascript i enable the design mode as follows
iframe.contentDocument.designMode="on";
which works fine if i create my iframe inline. but if i load my iframe with a “src” attribute in my parent page and i turn on the design mode as follows:
iframes=document.getElementsByTagName('iframe');
for(iframe in iframes)
{
iframes[iframe].contentDocument.designMode="on";
}
then it doesnot work. how can i enable the iframe’s design mode from the container page if im loading the iframe specifying the src attribute? not inline!!
Thanks
Depending on the browser, there are a couple of potential issues:
contentDocumentfor...inis not guaranteed to work on aNodeList, which is whatgetElementsByTagName()returns. Useforloop instead.loadevent will fire only once all the iframes have loaded.Otherwise, so long as the iframe is served from the same domain, it is possible to set its document’s
designModeproperty from the containing document. The following should work: