XHTML Popup Link

If you're writing XTHML 1.0 then you'll not be able to use the target attribute to open links in a new window AND have the page validate as XHTML. You can get around this with the use of JavaScript and the onclick (or onkeypress) event.

The javascript:

<script language="JavaScript" type="text/javascript">
function targetBlank (url) 
   {
   blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
   }
</script>

The anchor:

<a href="http://mindspill.net" onclick="targetBlank(this.href);return false;">mindspill.net</a>

It will generate this link: mindspill.net.

Also See

If you want a truly accessible link, which does not rely on Javascript, read this article: A List Apart: Articles: Accessible Pop-up Links.

Last modified: 06/05/06 20:48:44
Go to top

Related Pages

No related pages or links.

Login/out

Login

Forgot Password?
Go to top
Go to top