Attribute "target" exists, but can not be used for this element.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://www.google.com/" target="_blank">Google</a> |
I found a nice work around that does not involve window.open, using jquery we can hack the attribute on 'after' the dom has loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://www.google.com/" class="target-blank">Google</a> | |
<script type="text/javascript"> | |
$j(document).ready(function() { | |
$j('a.target-blank').click(function() { | |
this.target = '_blank'; | |
}); | |
} | |
</script> |
Now instead of target='_blank' you can just use class='target-blank', if the browser does not support javascript it will not open in a new window but the link will still work - and we have our valid xhtml.
Resources