> Richard Czeiger wrote:
> Hi guys - having a little problem with the whole external links in
> XHTML strict.
> Code's below - doesn't seem to be working - can you help out?

You were missing a couple of opening brackets, script below now works
ok.

Regards
Jason

<script type="text/javascript">

function externalLinks(){

  if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++){
                var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel")
=="external") { 
                        anchor.target = "_blank"; 
                }
    }
}
window.onload = externalLinks;

</script>


******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to