Wednesday, August 10, 2011 | By: nika perales

XHTML: Open link in new window

the target attribute has been deliberately removed from xhtml, thus making it difficult for people getting started creating websites using xhtml unable to open links in new windows like in html. Here's the code to help you open a target link in a new window

add this to the head or to an external file which you can reference
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');
}
 

then add the onlick event like this
The test domain in a new window

0 comments:

Post a Comment