Jump to content

[Solved]the difference between "document.getElementsByTagName('iframe')" and "document.parentwindow.frames"?


Recommended Posts

Posted (edited)
$tFrame = $oIexp.document.getElementsByTagName('iframe').item(0)

$oFrame = $oIexp.document.parentwindow.frames.item(0)

As shown above,

$tFrame and $oFrame,

what is the difference between the two Frames objects obtained by the two methods?

Because problems are found during use:

1 、$tFrame.attributes() can work

1 、$oFrame.attributes() can not work

So some doubts, hope to understand more clearly.

Thanks in advance!

Edited by Letraindusoir
Posted

Hello,

 $oIexp.document.getElementsByTagName('iframe').item(0)  returns HTMLFrameElement object
 $oIexp.document.parentwindow.frames.item(0) returns HTMLWindow2 object

 

Saludos

 

Posted

Hello,

 $oIexp.document.getElementsByTagName('iframe').item(0)  returns HTMLFrameElement object
 $oIexp.document.parentwindow.frames.item(0) returns HTMLWindow2 object

 

Saludos

 

Posted (edited)


Thank all masters  for the help!

I seem to understand what's going on.....

$tForm =$oIexp.document.getElementsByTagName('form').item(0)

$oForm = $oIexp.document.forms.item(0)

The above seems to be equivalent object. No errors were found in use.

but

$tFrame = $oIexp.document.getElementsByTagName('iframe').item(0)

$oFrame = $oIexp.document.parentwindow.frames.item(0)

those are different types of objects, so there are errors

Edited by Letraindusoir

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...