window.opener.location.href does not work on Mac.

Discussion in 'Javascript' started by alison, Nov 21, 2005.

  1. alison

    alison Guest

    I am trying to redirect the parent page when the user clicks an html
    button in an aspx page by using the javascript:
    window.opener.location.href="EditOrders.aspx"; This works fine on IE
    for windows or Firefox, however on IE for Mac or Safari on Mac, it
    doesn't work. If I enable script errors on IE for Mac, I get:
    'window.opener.location' is not an object. Any ideas on how to get this
    to work on Mac browsers? Thanks!
    alison, Nov 21, 2005
    #1
    1. Advertising

  2. alison

    VK Guest

    alison wrote:
    > I am trying to redirect the parent page when the user clicks an html
    > button in an aspx page by using the javascript:
    > window.opener.location.href="EditOrders.aspx"; This works fine on IE
    > for windows or Firefox, however on IE for Mac or Safari on Mac, it
    > doesn't work. If I enable script errors on IE for Mac, I get:
    > 'window.opener.location' is not an object. Any ideas on how to get this
    > to work on Mac browsers?


    Try instead window.opener.document.location.href="EditOrders.aspx";
    (this is not better and you variant is more correct, but just to sort
    out all options).
    VK, Nov 21, 2005
    #2
    1. Advertising

  3. alison

    alison band Guest

    Thanks, but that still doesn't work. If I enable IE on Mac to display
    script errors, it displays: "'window.opener.document' is not an object".



    *** Sent via Developersdex http://www.developersdex.com ***
    alison band, Nov 22, 2005
    #3
  4. alison wrote:

    > I am trying to redirect the parent page when the user clicks an html
    > button in an aspx page by using the javascript:


    Hopefully you are not using the `javascript:' label here as that would
    be either useless or error-prone.

    > window.opener.location.href="EditOrders.aspx"; This works fine on IE
    > for windows or Firefox, however on IE for Mac or Safari on Mac, it
    > doesn't work. If I enable script errors on IE for Mac, I get:
    > 'window.opener.location' is not an object. Any ideas on how to get this
    > to work on Mac browsers? Thanks!


    Try alert(window) and alert(window.opener) to see if both refer to an
    object. If either does not, it would be prudent if you posted how you
    opened the new window. If it does, try alert(window.opener.location).
    If that returns the URL of the document displayed in the opening window,
    try

    if (window.opener && !window.opener.closed)
    {
    window.opener.location = "EditOrders.aspx";
    }

    instead.


    HTH

    PointedEars
    Thomas 'PointedEars' Lahn, Nov 23, 2005
    #4
    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. Leon
    Replies:
    1
    Views:
    10,175
    Boban Dragojlovic
    Jun 24, 2003
  2. Jiong Feng
    Replies:
    9
    Views:
    1,334
    Lasse Reichstein Nielsen
    Jun 24, 2004
  3. saiho.yuen
    Replies:
    3
    Views:
    409
    kaeli
    Sep 14, 2004
  4. Valentin Botog

    window.location.href on Mac browsing IE

    Valentin Botog, Aug 11, 2005, in forum: Javascript
    Replies:
    1
    Views:
    108
    Mick White
    Aug 11, 2005
  5. window.opener, form.opener?

    , Jul 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    272
Loading...

Share This Page