Click link in embeded Object trigger parent window reload?

Discussion in 'Javascript' started by Mark Anderson, Jun 28, 2007.

  1. Hi. I've had to turn an IFrame-embedded page into a an Object using the
    data attribute to hold the page to meet XHTML STRICT validation. The
    <object>'s embedded page is a query URL returning a basic HTML page to
    hold an <a> link enclosing a thumbnail of a latest added record in a
    picture database. So far, so good.

    What I need is that clicking the embedded image/link causes the parent
    page to load a new URL. What syntax do I use to refer to the 'parent'
    page rather than the page actually containing the <a> link.

    Actually I could probably us the thumbnail <img>'s onclick event rather
    than an enclosing <a> link but the same syntax problem arises. Sorry, no
    URL to show as the page in on an intranet (which is also the eventual
    deployment scenario - with a mind to security issues, etc.)

    TIA

    Mark
     
    Mark Anderson, Jun 28, 2007
    #1
    1. Advertising

  2. Mark Anderson

    d d Guest

    Mark Anderson wrote:
    > Hi. I've had to turn an IFrame-embedded page into a an Object using the
    > data attribute to hold the page to meet XHTML STRICT validation. The
    > <object>'s embedded page is a query URL returning a basic HTML page to
    > hold an <a> link enclosing a thumbnail of a latest added record in a
    > picture database. So far, so good.
    >
    > What I need is that clicking the embedded image/link causes the parent
    > page to load a new URL. What syntax do I use to refer to the 'parent'
    > page rather than the page actually containing the <a> link.
    >
    > Actually I could probably us the thumbnail <img>'s onclick event rather
    > than an enclosing <a> link but the same syntax problem arises. Sorry, no
    > URL to show as the page in on an intranet (which is also the eventual
    > deployment scenario - with a mind to security issues, etc.)
    > TIA
    > Mark


    Is this what you're looking for ?

    onclick="parent.location.href='http://example.com';"

    ~dd
     
    d d, Jun 29, 2007
    #2
    1. Advertising

  3. "d d" <> wrote in message
    news:f61ejj$lrp$03$-online.com...
    > Is this what you're looking for ?
    >
    > onclick="parent.location.href='http://example.com';"
    >
    > ~dd


    Thanks. Having started out from a context of frames/iframes I'd headed
    down quite the wrong path.

    However, it's not quite the solution - it works in Safari & Firefox but
    IE (v6) loads the called page into the clicked <object>. Is this an IE
    bug or is some conditional syntax needed for different UAs?

    Mark
     
    Mark Anderson, Jun 29, 2007
    #3
  4. Mark Anderson

    d d Guest

    Mark Anderson wrote:
    > "d d" <> wrote in message
    >> Is this what you're looking for ?
    >> onclick="parent.location.href='http://example.com';"

    > Thanks. Having started out from a context of
    > frames/iframes I'd headed down quite the wrong path.
    > However, it's not quite the solution - it works in Safari & Firefox but
    > IE (v6) loads the called page into the clicked <object>. Is this an IE
    > bug or is some conditional syntax needed for different UAs?
    > Mark


    Hard to comment without seeing the code, but maybe
    try using top.location.href instead.

    ~dd
     
    d d, Jun 29, 2007
    #4
  5. "d d" <> wrote in message
    news:f62krh$ftb$01$-online.com...
    > Mark Anderson wrote:
    >> "d d" <> wrote in message
    >>> Is this what you're looking for ?
    >>> onclick="parent.location.href='http://example.com';"

    >> Thanks. Having started out from a context of frames/iframes I'd
    >> headed down quite the wrong path.
    >> However, it's not quite the solution - it works in Safari & Firefox
    >> but IE (v6) loads the called page into the clicked <object>. Is this
    >> an IE bug or is some conditional syntax needed for different UAs?
    >> Mark

    >
    > Hard to comment without seeing the code, but maybe
    > try using top.location.href instead.
    >
    > ~dd


    Understood, here's a test page I've made it as simple as possible so as
    to try and avoid side issues. I've added the onclick to the image in
    the 'embedded' page. Code is validating XHTML 1.0 Strict.

    Both top.location and parent.location work in Safari(v2), Firefox(v2
    Mac/Win). IE6 persists in loading the resulting page back into the
    calling object not the parent frame (...and you guessed, the main target
    browser is IE <sigh>).

    Regards

    Mark
     
    Mark Anderson, Jun 29, 2007
    #5
    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. Joshua Beall
    Replies:
    26
    Views:
    220,708
    AndreiKaa
    Jun 29, 2007
  2. vseshan204
    Replies:
    3
    Views:
    3,624
    Vangi
    Jul 27, 2009
  3. Blue®
    Replies:
    4
    Views:
    814
    Blue®
    Sep 27, 2003
  4. PWalker
    Replies:
    1
    Views:
    137
    David Lionetti
    Feb 24, 2005
  5. Replies:
    0
    Views:
    289
Loading...

Share This Page