[UPHPU] xhtml strict and open in new window

Tyler Gee geekout at gmail.com
Wed May 10 20:58:41 MDT 2006


> This part would normally redirect the current window to test.com:
>
>   <a href="http://test.com/">Link Text</a>
>
> Does this:
>
>   <a href="http://test.com/" onclick="window.open(this.href); return
> false;">Link Text</a>
>
> keep the current window where it is (in my case, mscis.org), but open a
> new window that goes to test.com?

I'm not sure...that was the method I recommended NOT doing.

If you specify the ref="extrernal" attribute and then rewrite the
target attribute in the DOM (as the articles did), there is no
confusion as which which links will open in a new window and which
ones will not.

However, if you go with the approach above, you will need to have some
additional javascript which stops the processing of the href attribute
in the parent window, otherwise it would seem that it would open a new
child window that points to test.com and redirect the parent window to
test.com as well.  That might be what the 'return false;' is
attempting, but I am pretty sure that doesn't stop processing in a
cross-browser kind of way.

Tyler



More information about the UPHPU mailing list