Set Parent Scroll Position - parent page and iframe on seperate domains

P

PD

I have a parent .Net page (http://mywebsite/project.aspx) that has an
iframe (http://iframe/iframe.aspx) which are on seperate domains. I
need to adjust the scrolling on the parent window due the size of the
iframe. It displays a rather lengthy message which causes scrolling on
the parent page (not in the iframe) which is what the UI folks want. I
need to be able to scroll the parent page from a click in the iframe.
After they read this message, they click on a link at the bottom. At
that point, they get redirected to another page, but the scroll
position remains, so they can't see the new page content since it's not
that lengthy. Each time I try to access either parent.window.scollTo or
a function on the parent page from the iframe I get an access denied. I
have read posts that state you can not go across domains, hence the
access denied error.

Is there another way that I can set the scroll position on the parent
page from the iframe page?

Any thoughts/suggestions would be greatly appreciated.

PD
 
A

ASM

PD a écrit :
I just made those names up to ensure the difference between the 2
domains.

but, as I don't understand your question about parent scrolling ...

in the iframe, the link :
<a href="#" onclick="parent.location=parent.location+'#somewhere';
retur false;">somewhere</a>

won't scroll to div of id 'somewhere' in main page ?
 
P

PD

I get a "access denied" message because the main page resides on a
differnet domain then the iframe page.
 
A

ASM

PD a écrit :
I get a "access denied" message because the main page resides on a
differnet domain then the iframe page.

the alone way I found is to use 'normal' html

http://stephane.moriaux.perso.wanadoo.fr/truc/test_iframe_denied
scroll down to the white iframe

3 examples :
-1- in pure html (with target)
-2- with some JS accepted by my Fx (compatible strict ?)
and I don't know why that works ? !
-3- doesn't work : calling parent.location ==> 'denied'

other tests using similar location.href directly in onclick in links
returned 'denied'

test using a variable getting self.location in parent file
==> denied too ... :-(
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top