Tuesday, May 31, 2011

Common Problem:

Popups are being blocked on browsers when the window is opened asynchronously. For example, needing to do some action on server before opening the window popup.

Since the window is not opened right after the user initiative, the window is being blocked.

The Solution:

  1. Opening the window with empty URL and give the window a name. window.open("", name, WindowProperties);
  2. Asynchronously do the round trip to the server and request for data calculation or some server actions.
  3. When returning to client, refreshing the opened window by calling window.open again with the relevant URL and the same window name. window.open(url, name, WindowProperties);