I can not get the contents of a div which is in a large number of iframe. Example:

<iframe> <iframe> <div id="1"></div></iframe> </iframe> <iframe> </iframe> 

I can immediately warn id iframe isn’t exactly there, but it is constantly changing and means that it is not unique. To get a div just by ID will not succeed so first you need to get access to the frame in which it is located. I tried this:

  var ifrs=window.parent.document.getElementsByTagName('iframe'); var fr; for(var i=0; i < ifrs.length; i++ ) { var ifrsi=ifrs[i]; var DOC = ifrsi.contentDocument; var result = DOC.getElementById("1"); } 

It turned out to find only the main frame of the frame, but did not find the frames that are inside these frames, because again you need to get access to the frames.

So I can not figure out how to get to this div.

It turned out to get to the desired FRAME, but receives it as an object:

 window.frames['ext-gen-top66'].contentDocument.getElementsByTagName('iframe'); 

view of what is happening

 [iframe#ext-comp-785523, iframe#detail-ext-gen-listdetail-0-23-458611.ux-mif, ext-comp-785523: iframe#ext-comp-785523, list-ext-gen-listdetail-0-22-154430: iframe#ext-comp-785523, detail-ext-gen-listdetail-0-23-458611: iframe#detail-ext-gen-listdetail-0-23-458611.ux-mif] 
  • Is someone still using the iframe ? Frame frame what happens? - Mr. Black
  • Here I am in shock. But unfortunately they do not allow me to touch html. - Michael
  • I understand that iframe has src from different documents and all three of them? The first iframe refers to the second iframe, and the second to the div? - Mr. Black
  • Yes. Just how to get the content without having an id frame - Michael

0