Bonjour à tous,
Voilà une source que j'ai trouvé sur le net qui permet de savoir si un anti-popup est installé.
Ma question est la suivante : est-il possible que le message ne soit pas affiché dans un label mais dans un tableau et qu'une image soit affichée en fonction du message qui s'affiche ?
Je suis novice donc, je ne sais pas trop comment faire.
Merci d'avance.
<html>
<head>
</head>
<body onLoad="StartT()">
<div id="label0"><b><font color="#FF0000">Attention! The popup killer breaks java-scripts on this page</font></b></div>
<SCRIPT LANGUAGE="JavaScript">
ns4=document.layers
ie4=document.all
ns6=document.getElementById&&!document.all
var xWin=null; var ticks=6;
function ChangeLabel0(txt){
if(ns4){document.layers.label0.innerHTML=txt}
if(ie4){document.all.label0.innerHTML=txt}
if(ns6){document.getElementById("label0").innerHTML=txt}
}
function StartT(){
StartPopup();
window.focus();
ChangeLabel0("<b>Popup window appears in "+ticks+" sec. Wait please...</b>");
}
function StartPopup(){
xWin=window.open("pop.htm#abc");
setTimeout("test_xWin()",700);
}
function test_xWin(){
// alert("typeof(xWin)="+typeof(xWin));
// alert("typeof(xWin.location.href)="+typeof(xWin.location.href));
// alert("xWin="+xWin);
// alert("xWin.location.hash="+xWin.location.hash);
if ( (xWin==null)
||(typeof(xWin)=="undefined")
||(typeof(xWin.location.hash)!="string")
// ||(xWin.location.hash!="#abc")
){sMsg="<font color=#FF0000><b>A popup killer is detected</b></font>";}
else{sMsg="<font color=#008000><b>NO popup killer is detected</b></font>";};
//alert("xWin="+xWin+" type="+typeof(xWin)+" typeloc="+typeof(xWin.location.hash)+" hash="+xWin.location.hash);
window.focus();
ChangeLabel0(sMsg);
}
</SCRIPT>
</body>
</html>