tags:

views:

1346

answers:

3

Our java applet needs to open a new htm page to web browser but popup blocker seem to block this code:

  try
    {
      AppletContext a = getAppletContext();
      URL url = new URL(link);
      a.showDocument(url,"_blank");
    }

can you use somehow live javascript to open a window instead?

A: 

I am fairly sure that any popup blocker worth its salt will block popups. No matter what you put on your page, there are very few ways to actually spawn a new window, and all of these will almost certainly be covered.

So think about if you really need to spawn a popup window in an environment where the client is likely to have these installed. If it's a legitimate purpose it may not be unreasonable to ask the client to whitelist your site in their popup blocker.

Andrzej Doyle
+5  A: 

I'm probably not being helpful, but a popup blocker's task is to block popups. If there was a way to fool it, it would not be a good blocker after all.

You will have to advise your users to disable the popup blocker to use your application.

Sebastian Dietz
+1  A: 

AppletContext show document is implemented by doing the JavaScript call. However, the context the popup blocker is using will probably be absent. If the click happens outside of an applet you can use only JavaScript to open the popup, but using a URL supplied by the applet (so the applet never has to call out to JavaScript).

Tom Hawtin - tackline