Using Javascript to look at a frame's contents from another (sibling)frame

Discussion in 'Javascript' started by Aaron C, Nov 21, 2009.

  1. Aaron C

    Aaron C Guest

    Hey all,
    I am having a hard time getting something to work, and am hoping that
    the collective experience of this group can help me out.

    I have built myself a helper-frameset to make searches a little
    faster. Yes, it's lazy of me, and unneccesary, but I wanted a project.

    the manual process this replaces:
    1) go to the "advanced search" page of a social networking site
    2) enter the keyword that I'm searching on
    3) enter the limiting criteria
    4) open each person's profile to see if they match what I need
    5) Lather, rinse, repeat. I have multiple keywords (always from the
    same list) for each of my limiting criteria.

    Currently, the frameset loads a page that I built with an input box,
    and a few links. Type the limiting criteria in to the box, hit go. The
    page reloads with links that have each of the keywords for those
    criteria. Each of the generated links combines steps 1-3 into one
    click.

    What I'm trying to find is a way to use the top frame (name="_top"),
    where all of those links are, to recreate a table of links from the
    bottom frame (name="_bott").

    Where I'm stuck is getting javascript in _top to read ANYTHING in
    _bott. I don't know if I have bad syntax, or if i'm missing a step in
    my code, or if what I'm trying to do is actually even possible.

    Any way you can help?
     
    Aaron C, Nov 21, 2009
    #1
    1. Advertising

  2. Aaron C

    Doug Gunnoe Guest

    Re: Using Javascript to look at a frame's contents from another(sibling) frame

    On Nov 21, 5:29 am, Aaron C <> wrote:
    > Hey all,
    > I am having a hard time getting something to work, and am hoping that
    > the collective experience of this group can help me out.
    >
    > I have built myself a helper-frameset to make searches a little
    > faster. Yes, it's lazy of me, and unneccesary, but I wanted a project.
    >
    > the manual process this replaces:
    > 1) go to the "advanced search" page of a social networking site
    > 2) enter the keyword that I'm searching on
    > 3) enter the limiting criteria
    > 4) open each person's profile to see if they match what I need
    > 5) Lather, rinse, repeat. I have multiple keywords (always from the
    > same list) for each of my limiting criteria.
    >
    > Currently, the frameset loads a page that I built with an input box,
    > and a few links. Type the limiting criteria in to the box, hit go. The
    > page reloads with links that have each of the keywords for those
    > criteria. Each of the generated links combines steps 1-3 into one
    > click.
    >
    > What I'm trying to find is a way to use the top frame (name="_top"),
    > where all of those links are, to recreate a table of links from the
    > bottom frame (name="_bott").
    >
    > Where I'm stuck is getting javascript in _top to read ANYTHING in
    > _bott. I don't know if I have bad syntax, or if i'm missing a step in
    > my code, or if what I'm trying to do is actually even possible.
    >
    > Any way you can help?


    If the bottom frame contains a page loaded from a different domain,
    you can't do it.

    http://en.wikipedia.org/wiki/Same_origin_policy

    I thought the FAQ covered this specifically, but I don't see it:

    http://www.jibbering.com/faq/#frameRef
     
    Doug Gunnoe, Nov 21, 2009
    #2
    1. Advertising

  3. Re: Using Javascript to look at a frame's contents from another (sibling) frame

    In comp.lang.javascript message <ed6eac53-0d59-47ea-8442-504e0ef4e481@x5
    g2000prf.googlegroups.com>, Sat, 21 Nov 2009 03:29:42, Aaron C
    <> posted:
    >
    >Where I'm stuck is getting javascript in _top to read ANYTHING in
    >_bott. I don't know if I have bad syntax, or if i'm missing a step in
    >my code, or if what I'm trying to do is actually even possible.
    >
    >Any way you can help?



    A copy of <URL:http://www.merlyn.demon.co.uk/linxchek.htm> does that,
    accessing the whole displayed text and the links and anchors arrays. To
    see how, scan its source for "Fram" and read near where you see it.
    Everything it reads is on the same system as it is itself.

    But, from your description, ISTM that you may be trying to use a page in
    your domain to read the content of an iframe loaded from an alien
    domain.

    And ISTM that, if that could be done, it could easily be misused.

    You should, of course, have mentioned the nature of the error messages
    reported in the Error Console or equivalent. For me, Firefox generally
    gives the most rapidly useful report; but, where that does not help
    enough, the extra detail on Opera is sometimes useful.

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
    Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
    PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
    Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
     
    Dr J R Stockton, Nov 21, 2009
    #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. Replies:
    11
    Views:
    666
    Fredrik Lundh
    Jan 23, 2006
  2. Java_Forum

    Reaching a sibling frame ?????

    Java_Forum, Sep 4, 2003, in forum: Javascript
    Replies:
    2
    Views:
    118
    kaeli
    Sep 4, 2003
  3. Replies:
    0
    Views:
    129
  4. Rob
    Replies:
    11
    Views:
    234
  5. jman
    Replies:
    2
    Views:
    131
    Martin Honnen
    Dec 12, 2008
Loading...

Share This Page