Controlling what position a page loads in

Discussion in 'Javascript' started by Jason, Jan 30, 2007.

  1. Jason

    Jason Guest

    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
     
    Jason, Jan 30, 2007
    #1
    1. Advertising

  2. Jason

    Randy Webb Guest

    -Lost said the following on 1/29/2007 11:54 PM:
    > "Jason" <> wrote in message
    > news:...
    >> 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/
     
    Randy Webb, Jan 30, 2007
    #2
    1. Advertising

  3. Jason

    -Lost Guest

    "Randy Webb" <> wrote in message
    news:...
    > -Lost said the following on 1/29/2007 11:54 PM:
    >> "Jason" <> wrote in message
    >> news:...
    >>> 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.
     
    -Lost, Jan 30, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Spiegel

    Controlling Placeholder Position

    John Spiegel, Mar 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,500
    John Spiegel
    Mar 4, 2004
  2. =?Utf-8?B?UGhpbGlwcGUgVi4=?=

    Controlling the srolling bar position in ASP & C#

    =?Utf-8?B?UGhpbGlwcGUgVi4=?=, May 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    468
    Kevin Spencer
    May 17, 2004
  3. Mario Figueiredo
    Replies:
    1
    Views:
    421
    Jack Klein
    Nov 16, 2006
  4. Jer

    Controlling DataGrid scrollbar position

    Jer, Nov 28, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    119
  5. Jason
    Replies:
    0
    Views:
    80
    Jason
    Jan 30, 2007
Loading...

Share This Page