Calling a function in an iframe

Discussion in 'Javascript' started by Aaron Gray, Mar 12, 2007.

  1. Aaron Gray

    Aaron Gray Guest

    How do I call a function within an iframe from the container main document ?

    Many thanks in advance,

    Aaron
     
    Aaron Gray, Mar 12, 2007
    #1
    1. Advertising

  2. Aaron Gray

    Aaron Gray Guest

    "Randy Webb" <> wrote in message
    news:...
    > Aaron Gray said the following on 3/12/2007 1:21 PM:
    >> How do I call a function within an iframe from the container main
    >> document ?

    >
    > iFrameRef.functionName();


    I was using the "name" attribute rather than "id" on the IFrame !

    Aaron
     
    Aaron Gray, Mar 12, 2007
    #2
    1. Advertising

  3. Aaron Gray

    ASM Guest

    Aaron Gray a écrit :
    > "Randy Webb" <> wrote in message
    > news:...
    >> Aaron Gray said the following on 3/12/2007 1:21 PM:
    >>> How do I call a function within an iframe from the container main
    >>> document ?

    >> iFrameRef.functionName();

    >
    > I was using the "name" attribute rather than "id" on the IFrame !


    iFrameref = parent.myIframeName;

    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
     
    ASM, Mar 12, 2007
    #3
  4. Aaron Gray

    OmegaJunior Guest

    On Mon, 12 Mar 2007 19:34:42 +0100, Aaron Gray <>
    wrote:

    > "Randy Webb" <> wrote in message
    > news:...
    >> Aaron Gray said the following on 3/12/2007 1:21 PM:
    >>> How do I call a function within an iframe from the container main
    >>> document ?

    >>
    >> iFrameRef.functionName();

    >
    > I was using the "name" attribute rather than "id" on the IFrame !
    >
    > Aaron
    >
    >


    var theIFrame = document.frames["theFrameName"];
    if((theIFrame)&&(theIFrame.theFunction))
    {
    var theResult = theIFrame.theFunction();
    }

    --
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
     
    OmegaJunior, Mar 16, 2007
    #4
    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. Andreas Lagemann
    Replies:
    8
    Views:
    496
    Mike Wahler
    Jan 10, 2005
  2. tiwy
    Replies:
    0
    Views:
    448
  3. Daedalous
    Replies:
    3
    Views:
    725
    Daedalous
    Jan 16, 2004
  4. mike

    calling a function from a iframe

    mike, Nov 16, 2005, in forum: Javascript
    Replies:
    5
    Views:
    145
    Richard Cornford
    Nov 16, 2005
  5. ukrbend
    Replies:
    13
    Views:
    150
    Thomas 'PointedEars' Lahn
    Dec 3, 2005
Loading...

Share This Page