468,533 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,533 developers. It's quick & easy.

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

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

May 3 '06 #1
6 14710
ASM
PD a écrit :
I have a parent .Net page (http://mywebsite/project.aspx) that has an


I saw any iframe in 'project.aspx' ... !

--
Stephane Moriaux et son [moins] vieux Mac
May 3 '06 #2
PD
I just made those names up to ensure the difference between the 2
domains.

May 4 '06 #3
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+'#somewhe re';
retur false;">somewhere</a>

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

--
Stephane Moriaux et son [moins] vieux Mac
May 4 '06 #4
PD
I get a "access denied" message because the main page resides on a
differnet domain then the iframe page.

May 4 '06 #5
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.wanado..._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 ... :-(
--
Stephane Moriaux et son [moins] vieux Mac
May 4 '06 #6
PD
Thanks for the info!! I'll take a look at the 'normal' html example.

May 10 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Stimp | last post: by
2 posts views Thread by Merlin | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.