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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title></title>
<script type="text/javascript">
var MaPopup;
function TesterPopup()
{
if(MaPopup == undefined)
alert("La popup n'existe pas !");
else if(MaPopup.name)
{
if(MaPopup.name == null)
alert("La popup n'existe pas !");
else
alert("La popup existe et s'appelle : " + MaPopup.name);
}
else
alert("La popup n'existe pas !");
}
function CreerDiv(Nom)
{
MaPopup = FollowPopup(Nom);
var NewDiv = MaPopup.document.createElement("div");
NewDiv.appendChild(MaPopup.document.createTextNode("Nouvelle Div"));
popupDiv = MaPopup.document.getElementById("MainDiv");
popupDiv.appendChild(NewDiv);
MaPopup.focus();
}
function FollowPopup(Nom)
{
Entete = "http://" + window.location.host + "/";
Page = "test/mapopup.html?liste=1,2,3";
Parametres = "width=300,height=300,location=1";
var LocalPop = window.open("", Nom, Parametres);
if(LocalPop.location.href == "about:blank")
LocalPop.location = Entete + Page;
return LocalPop;
}
</script>
</head>
<body>
<input type="button" value="Ajouter Div" onclick="CreerDiv('Pop');" />
<input type="button" value="Tester Popup" onclick="TesterPopup();" />
</body>
</html> |