Search code examples
javascripthtmlxhtmldom-eventsstandards

What's the best way to write a standards compliant popup window with XHTML and Javascript?


I'm writing standards compliant XHTML Strict 1.0, so including the HTML "target" attribute on anchor elements will not do.

I've read 2 fundamentally different ways using Javascript:

  1. Upon document load, find all links with rel='external' and append the target='_blank' attribute.

  2. Use the HTML onClick attribute that fires a Javascript popup(this) function, which opens windows with window.open().

These methods are now 5-6 years old, so I'm hoping things have solidified since then. What's the best way to do this?


Solution

  • With JQuery and Iframes (or an object instead)