SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict isuru's Avatar
    Join Date
    Nov 2000
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got a javascript function in one frame that I would like to access from another frame. Is this possible?

  2. #2
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    It's very possible. To access a frame, you go:

    parent.frameName

    and change frameName to the name of the frame you want to access. So, to access a function in anothe frame, just use:

    parent.frameName.window.functionName()

    and change functionName() to the name of your function.

    Hope that helps,
    aDog

  3. #3
    SitePoint Addict isuru's Avatar
    Join Date
    Nov 2000
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the info aDog, but how do I actually use a link to call the function?

  4. #4
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    You'd just go:

    Code:
    <a href="javascript:parent.frameName.window.functionName()">Other Frame Function</a>
    aDog
    <Edited by kyank on 01-23-2001 at 07:07 PM>


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
  •