Posts filed under 'XHTML'

XHTML: Open a link in a new window - V2

Marc-Antoine Ross February 3rd, 2007 Add comment

I used my friend Mario’s great post on how-to open a link in a new window to create a script that will open any external link in a new window without the need to add a CSS class to it. This is very useful when you want to change the behavior on a blog that already has a lot of posts.

<script type=”text/javascript” language=”JavaScript”>
    function externalLinks() {
        if (!document.getElementsByTagName) {
            return;
        }
        var anchors = document.getElementsByTagName(”a”);
        var sDom    = document.domain;
        for (var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if (anchor.getAttribute(”href”)) {
                iPosition = anchor.href.indexOf(sDom);
                if (iPosition == -1 || 
                    iPosition > sDom.length) {
                    anchor.target = ”_blank”;
                }
            }
        }
    }
    window.onload = externalLinks;
</script>

The Multipage Validator as an official Google button

Marc-Antoine Ross April 25th, 2006 Add comment

XHTML bases

Mario Laflamme March 15th, 2006 Add comment

XHTML: Open a link in a new window

Mario Laflamme March 9th, 2006 1 comment

Schedule

September 2010
M T W T F S S
« Sep    
 12345
6789101112
13141516171819
20212223242526
27282930