JavaScript: Getting the contents of a sibling frame?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Mr Red

Thread Starter
Joined
Dec 1, 2008
Messages
76
Clientside only. How to?

Tried some things that differ in FF2 and FF3.6

I usually check in IE5.5

And then only IE 6, 7, etc

Have tried in <DIV HREF="foo.htm"> also but not succeeded.

Not tried child frame yet.

Any Ideas?

TIA
 
Joined
Apr 17, 2010
Messages
41
......sorry, what do you want to do?

You need to be a little more specific with the question.

If you are trying to read the contents from an iFrame which already has content loaded into it, then you would use

var frameElement = document.getElementById(...name of the frame you are reading...);
var content = frameElement.contentWindow.document.body.innerHTML;


The same should work with any other frame, but you need to more clearly define your question.

The best programmers in the world (not that I'm purporting to be one, but I'm sure there's some **** hot ones on here) can't help if they don't know what you're trying to do...
 

Mr Red

Thread Starter
Joined
Dec 1, 2008
Messages
76
thanks.
Sibling frames need a bit more instruction. But that wasn't the line I was struggling with.
Code:
//var frameElement =  document.getElementById("wfeet"); 
 var frameElement =  parent.document.getElementById("wfeet"); 
 var con =  frameElement.contentWindow.document.body.innerHTML;
It works on FF2 & 3.6 IE5.5 & 8
There was a confusion with "indexOf" which I will start a new thread on.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top