URL Target Bug Demonstration

Platforms Affected

Netscape 3.x on the MacOS cannot open another HTML document using the showDocument() method using a target.

A blank browser window will be displayed instead of the document with the submitted URL.

Details On The URL Target Bug

If the target is "_blank", then a blank browser window is brought up all the time.

If the target is a named target such as "_mytarget", the first time you do a showDocument(), the browser will bring up a blank window. The subsequent time will populate the blank window with the URL and all will be fine.

The applet below demonstrates this bug if you have Netscape 3.x on a Mac.

URL Target Bug Workaround

For named targets, simply check in code to see if the browser is Netscape running on a MAC. If it is, then call showDocument() again.

There is no direct workaround for the "_blank" target where you always want a new Browser window to come up. In this case, I recommend that you randomly generate a target name and then pass this to showDocument(). With a random name (or a name based on an increasing counter your applet maintains), the problem boils back down to a named target issue. At this point, implement the same fix as the named target.

The applet at the bottom of this page demonstrates the named target fix. The _blank fix is basically an extension of this as described in the previous paragraph.

References

N/A. If you know of references, please submit them to me.

This bug was originally pointed out to me by Annette Strupp-Adams.

Applet Demonstrating URL Target Bug

View The Source To URLTargetBug.java

Applet With URL Target Bug Workaround

View The Source To URLTargetFix.java

Gunther Birznieks