changing _parent targets to _self on remote page

R

Rob

Hi Gang:

I have a page that loads a remote page into an IFRAME.
I don't have any control over this remote page though the page is owned by
the same company I work for.

The problem is that all of the pages have <base target='_parent'> specified
-- so every link will bust out of the IFRAME.

One solution I thought of was to load the page via a server side language,
then run through the DOM tree changing the base target to _self.

I'm thinking that there is an easier way to do this -- maybe have the iframe
load into a container frame. When a link is clicked on the remote page
(inside the iframe) it will create a new frame container thence always
keeping it inside the iframe and container frame.

Could I do that? How would I do that?

I created a dummy page as a cheap example:
http://www.speakeasy.org/~robo/js_prob
Clicking on the "parent target" link duplicates the problem I'm having.

TIA!
 
R

Richard Cornford

Rob said:
I have a page that loads a remote page into an IFRAME.

Standard security restrictions will prevent a remote page from being
accessed with scripts so you will not be able to alter it at all under
those circumstances. You can have that security restriction removed for
trusted sites in your various users' browsers, but that is quit an
effort to set up in itself.
I don't have any control over this remote page though
the page is owned by the same company I work for.

You cannot even ask for it to be changed? (it would be a quick search
and replace operation so wouldn't take too long)
The problem is that all of the pages have <base
target='_parent'> specified -- so every link will
bust out of the IFRAME.

One solution I thought of was to load the page via a
server side language, then run through the DOM tree
changing the base target to _self.

That would do it, but seems a bit extream.
I'm thinking that there is an easier way to do this --
maybe have the iframe load into a container frame. When
a link is clicked on the remote page (inside the iframe)
it will create a new frame container thence always keeping
it inside the iframe and container frame.

If the target is _parent then each navigation will only bump the
contents up one level in your page, so an IFRAME in an IFRAME would only
replace the outermost IFRAME (of course if a second link did the same
you would be back at square one.
Could I do that?

Yes, I cannot tell if it would help or not.
How would I do that?

HTML.

Richard.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top