By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,931 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

changing _parent targets to _self on remote page

P: n/a
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!
Nov 24 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rob wrote:
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.
Nov 24 '05 #2

P: n/a
On 2005-11-24, Rob <ro**********************************@speakeasy.ne t> wrote:
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.
could you use the dom to change the <base> tag?
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?


iframe inside iframe ?

Bye.
Jasen
Nov 25 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.