1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<script type="text/javascript">
var addLoadListener=function(){
if(window.addEventListener)return function(func){window.addEventListener('load',func,false);}
else if(document.addEventListener)return function(func){document.addEventListener('load',func,false);}
else if(window.attachEvent)return function(func){window.attachEvent('onload',func);}
return function(func){if(typeof window.onload!='function')window.onload=func;else{var oldonload=window.onload;window.onload=function(){oldonload();func();};}}
}();
addLoadListener(
function(){
var i,lnk,elt=document.getElementById('liens_a_rediriger');
lnk=elt && elt.getElementsByTagName('a');
if(!lnk)return;
for(i=0;i<lnk.length;i++){
lnk[i].onclick=function(){
return window.open('http://www.mondomaine.com/url/'+this.href),false;
};
}
}
);
</script>
</head>
<body>
<ul id="liens_a_rediriger">
<li><a href="http://www.google.com/">Google</a></li>
<li><a href="http://www.yahoo.com/">Yahoo</a></li>
<li><a href="http://www.msn.com/">MSN</a></li>
</ul>
</body>
</html> |
Partager