<body onLoad="nome della funzione">
oppure usi questo:
E poi nei links usi questa sintassi: <a rel="esterno" href="......>click</a><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") == "esterno") {
anchor.target = "_blank";
if (anchor.title) anchor.title += " (Il link apre una nuova finestra)";
if (!anchor.title) anchor.title = "Il link apre una nuova finestra";
}
}
}
window.onload = externalLinks();
</script>
Questo se vuoi validare la pagina, dato che in xhtml l'argomento target non esiste più, quella funzione te la simula.