[thelist] XHTML 1.0 Strict -no target attribute allowed?

Courtenay court3nay at gmail.com
Fri Oct 22 21:46:32 CDT 2004


>   <a onclick="window.open(this.href); return false;" onkeypress="window.open(this.href); return false;" href="abc">text</a>

also if you're concerned about strict, you're probably wanting to
separate presentation from content, so some javascript in the head
section is required (in a function that is body.onloaded)

var hrefs = document.getElementsByTagName('A');
for (i in hrefs)
{ 
  if (href[i].className == 'pop_me') 
     href[i].onclick = function() { window.open(this.href); return false; }
}

then in the link

<a href='abc.htm' class='pop_me'>text</a>

then any link with class pop_me will load in a new window, and your
code will look pretty. you'll also save yourself some bandwidth by not
repeating the onclick.



On a slightly different note, what about for people with no
javascript, but with frames?


More information about the thelist mailing list