Properties of contentDocument

Discussion in 'Javascript' started by Captain Paralytic, Feb 22, 2012.

  1. For years Joomla has had a small script used to adjust the hight of a
    frame:
    function iFrameHeight() {
    var h = 0;
    if ( !document.all ) {
    h = document.getElementById('blockrandom').contentDocument.height;
    document.getElementById('blockrandom').style.height = h + 60 + 'px';
    } else if( document.all ) {
    h = document.frames('blockrandom').document.body.scrollHeight;
    document.all.blockrandom.style.height = h + 20 + 'px';
    }
    }

    Just recently it has stopped working in FF & Chrome. I have altered it
    to use .contentDocument.body.scrollHeight

    But when did contentDocument.height disappear?
     
    Captain Paralytic, Feb 22, 2012
    #1
    1. Advertising

  2. On Feb 22, 2:44 pm, Jake Jarvis <> wrote:
    > On 22.02.2012 14:55, wrote Captain Paralytic:
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > For years Joomla has had a small script used to adjust the hight of a
    > > frame:
    > > function iFrameHeight() {
    > >    var h = 0;
    > >    if ( !document.all ) {
    > >            h = document.getElementById('blockrandom').contentDocument.height;
    > >            document.getElementById('blockrandom').style.height = h + 60 + 'px';
    > >    } else if( document.all ) {
    > >            h = document.frames('blockrandom').document.body.scrollHeight;
    > >            document.all.blockrandom.style.height = h + 20+ 'px';
    > >    }
    > > }

    >
    > > Just recently it has stopped working in FF & Chrome. I have altered it
    > > to use .contentDocument.body.scrollHeight

    >
    > > But when did contentDocument.height disappear?

    >
    > The following links appear relevant
    >
    > Gecko:https://developer.mozilla.org/en/DOM/document.height
    >
    > WebKit:http://trac.webkit.org/changeset/100847
    >
    > --
    > Jake Jarvis


    Thanks Jake. How did you happen upon them. I tried various searches
    but did not bring those up?

    To compound the problem, IE9 no longer seems to support the
    document.frames('blockrandom').document.body.scrollHeight call either!
     
    Captain Paralytic, Feb 22, 2012
    #2
    1. Advertising

  3. On Feb 22, 3:38 pm, Jake Jarvis <> wrote:
    > On 22.02.2012 16:17, wrote Captain Paralytic:
    > <...>
    >
    > > Thanks Jake. How did you happen upon them. I tried various searches
    > > but did not bring those up?

    >
    > <...>
    >
    > I looked in the "Gecko DOM Reference" on the Mozilla Developer Network
    > (https://developer.mozilla.org/En/DOM), and in the wiki that's linked as
    > "Web Developer Resources" fromhttp://www.webkit.org/
    >
    > --
    > Jake Jarvis


    Many many thanks. Have bookmarked them for future use.
     
    Captain Paralytic, Feb 22, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    0
    Views:
    918
    Nathan Sokalski
    Oct 17, 2005
  2. =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?=

    CompositeControls: ViewState properties w/ Mapped properties probl

    =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?=, Jan 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,141
    Steven Cheng[MSFT]
    Jan 19, 2006
  3. Kent Lichty
    Replies:
    0
    Views:
    838
    Kent Lichty
    Apr 16, 2004
  4. Eric Pickup
    Replies:
    2
    Views:
    150
  5. Richard P
    Replies:
    1
    Views:
    166
    Martin Honnen
    Aug 8, 2003
Loading...

Share This Page