Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using getElementById in frame structure

Status
Not open for further replies.

fairfaxVB

Programmer
Nov 3, 2005
46
US
Hi Friends,

I use a getElementById in page and works well.
however, it does not work when i put this page into frame structure.
myobject.newobject = document.getElementById(''PP'');
how do I change this syntax?

Thanks

FairfaxVB
 
getElementById works perfectly well with pages inside a frameset. However, if you are trying to access elements in a different frame, then you need to ensure that:

1. You use the correct DOM path to the frame and element, rather than just saying "document" (which will clearly not work), and

2. You ensure that both frames are in the same domain, otherwise you will run into security restrictions.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top