Reposition on a linked page with no anchor?

Discussion in 'Javascript' started by ukrbend, Dec 29, 2005.

  1. ukrbend

    ukrbend Guest

    I'm trying to create a link to a certain part of a page on another
    website that has
    no anchor (i.e. ID or name) at the position on the page I want to link
    to. So I can't do something like theotherpage.html#anchorname.
    However, since there is a unique keyword at the position I want to link
    to I thought perhaps I could load the page, then search for this
    keyword and then reposition to that point. Can javascript do something
    like this?

    Thanks
     
    ukrbend, Dec 29, 2005
    #1
    1. Advertising

  2. ukrbend

    Ivo Guest

    "ukrbend" wrote
    > I'm trying to create a link to a certain part of a page on another
    > website that has
    > no anchor (i.e. ID or name) at the position on the page I want to link
    > to. So I can't do something like theotherpage.html#anchorname.
    > However, since there is a unique keyword at the position I want to link
    > to I thought perhaps I could load the page, then search for this
    > keyword and then reposition to that point. Can javascript do something
    > like this?


    Yes, this is a common task for Javascript, but like anything Javascript, it
    will only work within one website. Cross-domain restrictions (google for
    that) prohibit script from your site to access scroll positions or anything
    on the other site. All I think of for this situation is you write to the
    other webmaster and ask for that anchor to be put there.

    hth
    ivo
    http://www.lear.shakespearians.com/
     
    Ivo, Dec 29, 2005
    #2
    1. Advertising

  3. ukrbend

    Trevor Guest

    Trevor, Dec 29, 2005
    #3
  4. ukrbend

    Trevor Guest

    Trevor, Dec 29, 2005
    #4
  5. ukrbend

    Lee Guest

    ukrbend said:
    >
    >I'm trying to create a link to a certain part of a page on another
    >website that has
    >no anchor (i.e. ID or name) at the position on the page I want to link
    >to. So I can't do something like theotherpage.html#anchorname.
    >However, since there is a unique keyword at the position I want to link
    >to I thought perhaps I could load the page, then search for this
    >keyword and then reposition to that point. Can javascript do something
    >like this?


    The short answer is "no".
    Javascript from one site can't access a document loaded from another site.

    The longer answer is that you might be able to cripple the security restrictions
    of your own browser to allow you to get away with it, but it's not something
    that you'll be able to talk other people into doing.
     
    Lee, Dec 30, 2005
    #5
  6. ukrbend wrote:

    > I'm trying to create a link to a certain part of a page on another
    > website that has no anchor (i.e. ID or name) at the position on the
    > page I want to link to. So I can't do something like
    > theotherpage.html#anchorname. However, since there is a unique
    > keyword at the position I want to link to I thought perhaps I could
    > load the page, then search for this keyword and then reposition to
    > that point. Can javascript do something like this?


    No. scrollIntoView(), which is also proprietary to the IE DOM,
    will not work when the target document is not already displayed.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Dec 30, 2005
    #6
    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. Mike

    Reposition Control

    Mike, Jul 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    350
    =?Utf-8?B?Sm9obiBTaXZpbGxh?=
    Jul 14, 2004
  2. ukrbend
    Replies:
    0
    Views:
    563
    ukrbend
    Dec 28, 2005
  3. Francesco Pietra

    reposition a column

    Francesco Pietra, Nov 25, 2009, in forum: Python
    Replies:
    0
    Views:
    272
    Francesco Pietra
    Nov 25, 2009
  4. schumigod

    How do I reposition Controls inside Panel in designer

    schumigod, Feb 9, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    288
    Steven Cheng[MSFT]
    Feb 9, 2007
  5. nospam

    reposition DIV element

    nospam, Sep 24, 2004, in forum: Javascript
    Replies:
    3
    Views:
    98
    Martin Honnen
    Sep 26, 2004
Loading...

Share This Page