Results 1 to 3 of 3

Thread: is it possible to run a function from another frame?

  1. #1
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Arrow is it possible to run a function from another frame?

    hello... is it possible to run a function from another frame?

    let's see this example
    <html>
    <head>
    <title>hum</title>
    <script type="text/javascript">
    function check(){
    // the code is here
    }
    </script>
    </head>
    <body>
    ha ha

    <iframe src="onother_iframe.html"></iframe>

    </body>
    </html>


    what should i write on my "another_iframe.html" to execute/run "function check"? what i want there is: function check run on "this page" ( sorry i dont know how to call this contained frame page), not run on "another_iframe.html".

    anyone?
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Since check apparently does nothing, it is irrelevant which page it runs against, though it could be passed an argument. That argument could be a page or an element on a page. However, to run it from the page in the iframe, just do:

    Code:
    parent.check();
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default so simple

    so simple, thanks..
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •