window.opener.refresh on other domain

Discussion in 'Javascript' started by jan@wandelwereld.be, Jun 22, 2006.

  1. Guest

    I know Window.opener.refresh() does not work if two windows are from a
    different domain.

    Anyone a (javascript)-solution for this problem ?

    tks
    Jan/
     
    , Jun 22, 2006
    #1
    1. Advertising

  2. Erwin Moller Guest

    wrote:

    > I know Window.opener.refresh() does not work if two windows are from a
    > different domain.
    >
    > Anyone a (javascript)-solution for this problem ?


    A solution so it will work?
    Yes and no.
    No as in: Javascript will not have access to another domain.
    You cannot 'solve' this, except in broken browsers.

    If you really need this, you'll have to use tricks like:
    (page1 is in domain 1, page2 in domain2, page2 wants to refresh page1)

    1) Make a simple page on the server of page1 (lets name it mustrefresh.php).
    This page return only 'refresh' or 'norefresh', depending on some variable
    set (via Database eg)
    2) Let page2 call some function (script) on its server which sets this
    variable so mustrefresh.php will return 'refresh', otherwise it will return
    'norefresh'.
    3) Let page1 poll (eg check every second) the mustrefresh.php.

    You'll have to add a unique value to every visitor to discriminate between
    them so mustrefresh.php knows if it must send 'refresh' or 'norefresh'

    Which is really all very cumbersome compared to pressing the refresh-button
    yourself of course...
    My advise would be: just don't, but it can be done. :)

    Regards,
    Erwin Moller


    >
    > tks
    > Jan/
     
    Erwin Moller, Jun 22, 2006
    #2
    1. Advertising

  3. ictp Guest

    Hi Erwin,

    tks for your response but we have to refresh the page :

    we can't change page 1 (the one who should be refresh).
    this page is the inbox/outbox/view/folder of a users mailbox in Domino
    WebAccess.

    a user select a mail (or more than one), presses a button, a new window
    appear (page 2) were the user can select some options. When the user
    press "move", the selected mails will be moved from his/her mailfile to
    a notes database. At that moment we have to refresh page 1, because the
    mails are disappeared in his/her mailbox.

    Notes Mailfiles are on server A, Notes applications are on server B
    (all web enabled)
    Scripts, windows, pages are all on server 2, because we can not change
    the design of the mailfiles.
    dnsnames are : mail.servers.ourcompany.com for the mailfiles and
    apps.servers.ourcompany.com


    please help
     
    ictp, Jun 22, 2006
    #3
  4. Erwin Moller Guest

    ictp wrote:

    > Hi Erwin,
    >
    > tks for your response but we have to refresh the page :
    >
    > we can't change page 1 (the one who should be refresh).
    > this page is the inbox/outbox/view/folder of a users mailbox in Domino
    > WebAccess.
    >
    > a user select a mail (or more than one), presses a button, a new window
    > appear (page 2) were the user can select some options. When the user
    > press "move", the selected mails will be moved from his/her mailfile to
    > a notes database. At that moment we have to refresh page 1, because the
    > mails are disappeared in his/her mailbox.
    >
    > Notes Mailfiles are on server A, Notes applications are on server B
    > (all web enabled)
    > Scripts, windows, pages are all on server 2, because we can not change
    > the design of the mailfiles.
    > dnsnames are : mail.servers.ourcompany.com for the mailfiles and
    > apps.servers.ourcompany.com
    >
    >
    > please help


    Hi,

    I would like to help you, but I cannot.
    Please be aware of the fact that IF crossdomain scripting was allowed (as it
    was in the good old days), you would not want to surf the web.
    Imagine the possibilities....
    In one window you have a site open of www.westeal.com, and in another window
    you have opened your online banking interface to your bank.
    If www.westeal.com could interact via javascript to the window of your
    bankaccount, it could also read the values you type like your username and
    password.
    You don't want that of course.

    I do think however that it should be possible to tell your browser that you
    deliberately WANT to domains to interact via javascript, but as far as I
    know this is nowhere implemented.

    Maybe (I do not know) IE can remove this restriction if you put both sites
    in your 'trusted zone'. Not sure.

    Hope this sheds some light on the issue. :-/

    Good luck!

    Regards,
    Erwin Moller

    PS: If you tested the 'trusted zone' thingy, please tell us your findings.
     
    Erwin Moller, Jun 22, 2006
    #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. Steve Wark
    Replies:
    3
    Views:
    6,634
    bruce barker
    Oct 28, 2004
  2. Andrew Bewley via DotNetMonster.com

    window to window communication (window.opener)

    Andrew Bewley via DotNetMonster.com, Feb 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,069
    Andrew Bewley via DotNetMonster.com
    Feb 3, 2005
  3. Urs Gubler
    Replies:
    0
    Views:
    158
    Urs Gubler
    Jul 2, 2003
  4. Yaron C.

    opener.opener ?

    Yaron C., Oct 30, 2003, in forum: Javascript
    Replies:
    4
    Views:
    219
    Yaron C.
    Nov 2, 2003
  5. window.opener, form.opener?

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

Share This Page