Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Set Parent Scroll Position - parent page and iframe on seperate domains

Reply
Thread Tools

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

 
 
PD
Guest
Posts: n/a
 
      05-03-2006
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

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      05-03-2006
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
 
Reply With Quote
 
 
 
 
PD
Guest
Posts: n/a
 
      05-04-2006
I just made those names up to ensure the difference between the 2
domains.

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      05-04-2006
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
 
Reply With Quote
 
PD
Guest
Posts: n/a
 
      05-04-2006
I get a "access denied" message because the main page resides on a
differnet domain then the iframe page.

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      05-04-2006
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
 
Reply With Quote
 
PD
Guest
Posts: n/a
 
      05-09-2006
Thanks for the info!! I'll take a look at the 'normal' html example.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is load testing a web service with seperate threads from one machinethe same as a single thread from seperate machines? ses Java 5 03-29-2011 03:36 PM
How to: set div scroll position on page load Mel ASP .Net 3 06-22-2009 11:07 PM
Seperate validation for seperate user controls on same page moondaddy ASP .Net 2 10-16-2006 04:03 AM
parent/iframe set iframe source and submit form superfreaker@gmail.com Javascript 2 03-09-2006 11:05 PM
=> Scroll IFrame Content to desired Position (JavaScript) Alexander Javascript 1 04-21-2004 08:22 PM



Advertisments