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

Julia julia at juliadesigns.net
Sat Oct 23 08:23:12 CDT 2004

At 03:46 23/10/2004, you wrote:

> > 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.

Me again!
Sorry to be such a pest, but:
I am still in javascript kindergarten, and whilst I understand the concept 
here, I am obviously missing some basic instructions to get this to work.
Could you tell me exactly how I put this "in a function that is 
body.onloaded" and how I call it in body onload?
I have tried calling the function:

function newWin()
then onclick =newWin()

and then putting that in body onload but it doesnt work.
thanks again,
(goes away humbly to read basic javascript tutorials.....)

More information about the thelist mailing list