469,630 Members | 1,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Controlling what position a page loads in

Matt suggests:

<BODY onload="window.scrollTo(x,y)">

However I am linking to Google Images so I can't modify their page
code.

Is there a way to link from frame a to frame b so that the javascript
in frame a decides and controls at what position the page will load?

Jas

Jan 30 '07 #1
3 3080
"Jason" <ja*******@gmail.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
Matt suggests:

<BODY onload="window.scrollTo(x,y)">

However I am linking to Google Images so I can't modify their page
code.

Is there a way to link from frame a to frame b so that the javascript
in frame a decides and controls at what position the page will load?
You could call it on a target frame. Load Google within a frame or layer and scroll
accordingly.

-Lost
Jan 30 '07 #2
-Lost said the following on 1/29/2007 11:54 PM:
"Jason" <ja*******@gmail.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
>Matt suggests:

<BODY onload="window.scrollTo(x,y)">

However I am linking to Google Images so I can't modify their page
code.

Is there a way to link from frame a to frame b so that the javascript
in frame a decides and controls at what position the page will load?

You could call it on a target frame. Load Google within a frame or layer and scroll
accordingly.
You will run into a security issue trying to script a frame with Google
in it from a frame that is not from the Google server.

The answer to the original question is a resounding no though.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 30 '07 #3
"Randy Webb" <Hi************@aol.comwrote in message
news:-K********************@telcove.net...
-Lost said the following on 1/29/2007 11:54 PM:
>"Jason" <ja*******@gmail.comwrote in message
news:11**********************@a75g2000cwd.googleg roups.com...
>>Matt suggests:

<BODY onload="window.scrollTo(x,y)">

However I am linking to Google Images so I can't modify their page
code.

Is there a way to link from frame a to frame b so that the javascript
in frame a decides and controls at what position the page will load?

You could call it on a target frame. Load Google within a frame or layer and scroll
accordingly.

You will run into a security issue trying to script a frame with Google in it from a
frame that is not from the Google server.

The answer to the original question is a resounding no though.
To the original poster, I apologize. I even tested it before posting to make sure I did
not provide misinformation.

I first tried it locally, loading local pages and then remotely loading pages from the
same server. It never dawned on me that it would not work loading content from another
source (uncaught exception: Permission denied to get property Window.scrollTo). I thought
regardless, your frameset would still "own" the frames. This is only true with content
residing in the same context as Randy pointed out.

Again, sorry about that!

-Lost

P.S. Totally off-topic, if you had a server-side language available you could retrieve
the results (cache them) and output the contents into your frames, then scroll
accordingly.
Jan 30 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Martien van Wanrooij | last post: by
1 post views Thread by Philippe V. | last post: by
6 posts views Thread by | last post: by
8 posts views Thread by GaryDean | last post: by
3 posts views Thread by Herb | last post: by
3 posts views Thread by Akhenaten | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.