Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> externalLinks - po co to jest?
piotrd
post
Post #1





Grupa: Zarejestrowani
Postów: 174
Pomógł: 0
Dołączył: 16.05.2006
Skąd: Łódź

Ostrzeżenie: (0%)
-----


spotkałem sie z takim rozwiązaniem w <head>:
Kod
<script type="text/javascript" language="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>

i nasuwa mi sie pytanie: po co ktos w ten sposób definiuje target? czy tak jest lepiej/łatwiej?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 07:05