xybrek xybrek - 1 year ago 128
Java Question

How to implement "Open Link in new Tab" without using HTML anchors (a) tags

How to implement "Open Link in new Tab" without dealing with HTML anchors (a)?

That is, for plain divs? Using anchor this is just by adding

href
attribute

How about for plain
div
s?

Answer Source

If this is a user action, add a click handler. Open a new window in onClick. If this is a code-driven action, just call this method:

Window.open("http://myApp.com/", "_blank", "");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download