www.webdeveloper.com
Results 1 to 6 of 6

Thread: accessing functions from iframes

  1. #1
    Join Date
    Nov 2002
    Location
    york, uk
    Posts
    4

    Unhappy accessing functions from iframes

    Could anyone help me out with the syntax to use a function that is contained within an iframe from the main frameset.

    I've tried

    parent.frames.selectRow(gr_reportDetails[0][gc6_REPORT_TYPE]);

    and abt a billion variations of that but with no luck.

    Please can anyone help?!?

  2. #2
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Not sure if I understand you but you can do something like this to access functions in an iframe:

    Code:
    document.frames['IFRAME_ID'].functionName();"
    IFRAME_ID I think can be either the iframe's ID, NAME or index (no need for the quotes in this case).

  3. #3
    Join Date
    Nov 2002
    Location
    york, uk
    Posts
    4

    still not working

    I've tried that syntax as below:

    document.frames['otherReports'].selectRow(1);

    but just get the error message "document.frames has no properties".

    What does this mean and why?

    Thanks

  4. #4
    Join Date
    Nov 2002
    Location
    England
    Posts
    275
    Have you got this page online? If not can you upload it and give us the URI, it will be quicker and easier that way to find the error.

  5. #5
    Join Date
    Sep 2005
    Posts
    12
    Quote Originally Posted by Rick Bull
    Not sure if I understand you but you can do something like this to access functions in an iframe:

    Code:
    document.frames['IFRAME_ID'].functionName();"
    IFRAME_ID I think can be either the iframe's ID, NAME or index (no need for the quotes in this case).
    can i accessing all iframes used in my page by index only not by their ids . ?
    paraguma

  6. #6
    Join Date
    Jul 2005
    Location
    USA
    Posts
    3,910
    It's window.frames[], not document.frames[].
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions

    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

    Check out my blog.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles