pop up blockers

Discussion in 'Javascript' started by optimistx, Oct 13, 2009.

  1. optimistx

    optimistx Guest

    How to transfer data between two windows without server programming ?

    It seems to be easy to pile numerous div:s on one page thus not needing to
    open new windows. All the 'quasi windows' can be accessed easily with any
    script.

    If we open a new window with javascript code, we get the handle to the new
    window and can communicate with its javascript contents easily (the same
    origin policy, all are 'my pages', the same server).

    If the user clicks the link and opens another window, my javascript program
    does not get the window handle. Or is there a simple way?

    One could send data by appending to the url, after ?-mark, but there is a
    limitation of length. I might need to send some kilobytes. Sending by
    post -request might be simple enough, once (the original page must not alter
    its state).

    Constructing frames is also a way, but when they are necessary for something
    else, at least for the time being, so I would like to avoid them. Cookies?
    No, they are in use for something else.

    Asking the users to adjust parameters for their pop up blockers is too
    complicated.

    Am I really forgetting a simple idea to solve this? Something to be done at
    the same time as the user clicks the link with <a href="newpage.htm"
    target="_blank">newpage</a> ? The user clicks the link and the two windows
    should be able to communicate (at least the originally open window should be
    able to send say 10 kb of data to the new window).

    Sorry if this question is too easy :)
     
    optimistx, Oct 13, 2009
    #1
    1. Advertising

  2. optimistx

    Stevo Guest

    optimistx wrote:
    > How to transfer data between two windows without server programming ?
    >
    > It seems to be easy to pile numerous div:s on one page thus not needing
    > to open new windows. All the 'quasi windows' can be accessed easily
    > with any script.
    >
    > If we open a new window with javascript code, we get the handle to the
    > new window and can communicate with its javascript contents easily (the
    > same origin policy, all are 'my pages', the same server).
    >
    > If the user clicks the link and opens another window, my javascript
    > program does not get the window handle. Or is there a simple way?
    >
    > One could send data by appending to the url, after ?-mark, but there is
    > a limitation of length. I might need to send some kilobytes. Sending by
    > post -request might be simple enough, once (the original page must not
    > alter its state).
    >
    > Constructing frames is also a way, but when they are necessary for
    > something else, at least for the time being, so I would like to avoid
    > them. Cookies? No, they are in use for something else.
    >
    > Asking the users to adjust parameters for their pop up blockers is too
    > complicated.
    >
    > Am I really forgetting a simple idea to solve this? Something to be done
    > at the same time as the user clicks the link with <a href="newpage.htm"
    > target="_blank">newpage</a> ? The user clicks the link and the two
    > windows should be able to communicate (at least the originally open
    > window should be able to send say 10 kb of data to the new window).
    >
    > Sorry if this question is too easy :)


    You could use session cookies and implement a whole communications
    protocol. For example, window A writes "Communication-Start" into a
    session cookie and waits for window B to delete that session cookie and
    replace it with one with "Communication-Start-Acknowledge". Then window
    A can write it's first packet of data into a session cookie and wait for
    window B to acknowledge it (after it's performed a checksum on it
    perhaps). I've never done this, but if faced with the problem you are, I
    might certainly bring it up as an idea in a brainstorming meeting to see
    how it's received.
     
    Stevo, Oct 13, 2009
    #2
    1. Advertising

  3. optimistx

    optimistx Guest

    Stevo wrote:
    > optimistx wrote:
    >> How to transfer data between two windows without server programming ?

    ...
    >
    > You could use session cookies and implement a whole communications
    > protocol. For example, window A writes "Communication-Start" into a
    > session cookie and waits for window B to delete that session cookie
    > and replace it with one with "Communication-Start-Acknowledge". Then
    > window A can write it's first packet of data into a session cookie
    > and wait for window B to acknowledge it (after it's performed a
    > checksum on it perhaps). I've never done this, but if faced with the
    > problem you are, I might certainly bring it up as an idea in a
    > brainstorming meeting to see how it's received.


    Thanks that you answered, especially when now you are the only one.
    Thus I might with some probability assume that there is no other
    straightforward method to solve this.
    I am already using cookies for the purpose so your idea is
    practical :)
     
    optimistx, Oct 20, 2009
    #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. Leo Muller

    work around popup blockers

    Leo Muller, Oct 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,493
    Hans Kesting
    Oct 13, 2004
  2. Mike Barnard

    Avoiding pop up blockers?

    Mike Barnard, Feb 18, 2008, in forum: HTML
    Replies:
    10
    Views:
    759
    Travis Newbury
    Feb 19, 2008
  3. D
    Replies:
    2
    Views:
    79
    McKirahan
    Nov 8, 2004
  4. optimistx

    Alert box and pop up blockers?

    optimistx, Oct 5, 2009, in forum: Javascript
    Replies:
    4
    Views:
    120
    Thomas 'PointedEars' Lahn
    Oct 7, 2009
  5. optimistx

    alert and pop-up blockers

    optimistx, Nov 25, 2009, in forum: Javascript
    Replies:
    7
    Views:
    101
    optimistx
    Nov 28, 2009
Loading...

Share This Page