Brian Meyer

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromBrian Meyer
ToMe
Subjectquestion regarding cross-domain iframe control
Date1 November 2005 18:03
I have read through most of your site on this subject, and you offer some
very interesting advice on it. I manage an intranet and an extranet for my
company, and they are hosted in two different places. I currently have my
extranet displaying some information from my intranet in an iframe, because
the information is driven from a database that resides inside the intranet.
The problem is that when displaying a list of links in the iframe, the
window gets scrolled down. When you click the link, it loads the details for
that choice in the iframe, but the parent page is still scrolled down. you
end up with a blank screen, because all of the information is up at the top.
I need to find a way to either: 1 - have the parent page ScrollTo(0,0)
whenever the iframe is a certain url, or 2 - figure out how to do a
server-side http read of the info on the intranet and re-write it to the
browser on the extranet. The only problem with this is that the extranet is
hosted at an ISP, and I don't have the ability to load third-party software
onto the server.

My sincerest thanks to you if you can help me out here.

Brian Meyer
FromMe
ToBrian Meyer
SubjectRe: question regarding cross-domain iframe control
Date3 November 2005 08:58
Brian,

> The problem is that when displaying a list of links in the iframe, the
> window gets scrolled down. When you click the link, it loads the details for
> that choice in the iframe, but the parent page is still scrolled down.

sounds like an interesting problem, but I am not sure I understand what you
mean by it getting scrolled down. Would you be able to give more details?

Also, where is the link that you are clicking? in the iframe or in the
parent? If it is in the parent, then this is easy. If it is in the iframe
then there are a few solutions I can think of, but the easiest is to use a
server side script that proxies the information from one to the other. This
is a fairly common thing to do.

There is actually a solution for safe cross-frame-and-domain communication
that will become a standard soon, but it is unfortunately not supported in
many major browsers yet, so this will have to wait.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromBrian Meyer
ToMe
SubjectRe: question regarding cross-domain iframe control
Date3 November 2005 13:29
Mark,
Thank you very much for your quick reply.

The page in the iframe is quite long, the iframe height is set to 2000, so
scrolling the parent window down to see the contents of the child is what
happens. The links are on the child page, and the link changes the child
page to a different page that is only maybe 500 pixels in height, but the
parent is still scrolled down, so the child loads off the top of the screen.

Actually, since I sent you this email, I did more digging on the server-side
proxy. I found that the xmlhttp object is part of the new version of DCOM,
so I tried it and it worked. I was quite elated with this discovery, because
it fixes so many other issues that I wasn't real happy with in the whole
"frames" world. I try to avoid them if at all possible, but when doing
cross-domain stuff, it was necessary. Not now! Having the server GET the
info from our other site and write it to the browser as if it came from
itself is wonderful!

Thanks again for your response.

Brian Meyer
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.