Accessing iframe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BillGatesFan

    #1

    Accessing iframe

    Alright, this is very strange. I call a javascript function in my page
    load that accesses an iframe and I get an error. But if I wait till the
    page completely loads and access the iframe through a click event
    everything works fine.

    I'm trying to set some of the iframe's properties on page load. Can I
    do this? Please give examples. Thanks

  • marktm

    #2
    Re: Accessing iframe

    The page must be completely loaded before you can reference an object
    within the DOM.
    Are you using <body onLoad="doSomet hing()"> ?

    -M

    Comment

    • BillGatesFan

      #3
      Re: Accessing iframe

      Yes you can say that. Is there anyway to get around it

      Comment

      • Baconbutty

        #4
        Re: Accessing iframe

        A useful page on IFRAMES is:-

        http://www.dyn-web.com/dhtml/iframes/

        [color=blue]
        >I'm trying to set some of the iframe's properties on page load.[/color]

        What in particular, and why?

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Accessing iframe

          marktm wrote:
          [color=blue]
          > The page must be completely loaded before
          > you can reference an object within the DOM.[/color]

          No. It is in most cases recommended to wait until that,
          but, depending on the DOM, it is possible before.


          PointedEars

          Comment

          Working...