1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

JavaScript: Getting the contents of a sibling frame?

Discussion in 'Software Development' started by Mr Red, Apr 17, 2010.

Thread Status:
Not open for further replies.
  1. Mr Red

    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
     
  2. liquid_vision

    liquid_vision

    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...
     
  3. Mr Red

    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.
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/917441

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice