Hola PatomaS, creo que te refieres a algo como esto ¿no?
Este seria el javascript
:
Código HTML:
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;
Aquí donde se cargaria:
Código HTML:
<script type="text/javascript" src="/external.js">
</script>
Y aquí donde se llama desde el enlace:
Código HTML:
<a href="document.html" rel="external">external link</a>
Aquí el artículo completo:
http://www.sitepoint.com/article/sta...ompliant-world