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

A

Aaron C

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?
 
D

Doug Gunnoe

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
 
D

Dr J R Stockton

In comp.lang.javascript message <ed6eac53-0d59-47ea-8442-504e0ef4e481@x5
g2000prf.googlegroups.com>, Sat, 21 Nov 2009 03:29:42, Aaron C
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,743
Latest member
WoodrowMea

Latest Threads

Top