can't access dynamically generated javascript function in parent frame

Discussion in 'Javascript' started by christine.nguyen@gmail.com, Oct 18, 2005.

  1. Guest

    Hello all,

    I have a page called test.html. Within test.html I have an iframe
    whose source is mypage.html. When mypage.html loads, it dynamically
    creates a javascript element which contains a function called doIt()
    and attaches it to the parent page, which is test.html. I have a
    button on test.html that then needs to call the dynamically attached
    doIt() function. I got this to work fine on Firefox and Opera on the
    Mac, but Safari is holding out on me. Any thought on this?? Any help
    would be appreciated.

    Thanks!
    chh
     
    , Oct 18, 2005
    #1
    1. Advertising

  2. Re: can't access dynamically generated javascript function in parentframe

    wrote:


    > I have a page called test.html. Within test.html I have an iframe
    > whose source is mypage.html. When mypage.html loads, it dynamically
    > creates a javascript element which contains a function called doIt()
    > and attaches it to the parent page, which is test.html. I have a
    > button on test.html that then needs to call the dynamically attached
    > doIt() function. I got this to work fine on Firefox and Opera on the
    > Mac, but Safari is holding out on me.


    What are you doing, creating a <script> element with e.g.
    document.createElement('script')
    and inserting that into the document?
    I think only the latest Safari 2.0.1 supports that, see
    <http://webkit.opendarwin.org/blog/?p=26>
    which says "Added support for loading external scripts and executing
    inline scripts by dynamically adding <script> elements to the DOM."


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Oct 19, 2005
    #2
    1. Advertising

  3. Guest

    Thanks, yes that is what I was doing. I figured out that the Safari
    version I was using didn't support that. Sucks to be me....I did
    figure out a way to do it though but had to take a whole different
    approach.
     
    , Oct 20, 2005
    #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. TJ
    Replies:
    5
    Views:
    993
    Walter Wang [MSFT]
    Jun 27, 2006
  2. Stuart Wexler

    Preselecting from parent frame to child frame

    Stuart Wexler, Apr 23, 2004, in forum: Javascript
    Replies:
    1
    Views:
    134
    Mick White
    Apr 23, 2004
  3. Angus the Fighter

    access another frame by one frame

    Angus the Fighter, Jul 19, 2004, in forum: Javascript
    Replies:
    2
    Views:
    109
    Angus the Fighter
    Jul 19, 2004
  4. Rob
    Replies:
    11
    Views:
    234
  5. Bitswapper
    Replies:
    5
    Views:
    178
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page