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
|
<html>
<script>
//netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
function afficheModal()
{
if (window.showModalDialog)
{
var test = "";
test = window.showModalDialog('testModal.html','popup','dialogWidth=400, dialogHeigh=300');
if(test!=null)
{
alert("le test est bon");
}
else
window.document.forms['testForm'].elements['texte'].value = "";
return true;
}
else
{
try
{
var test = "";
var pressed=false;
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
test = window.open('testModal.html?bt='+pressed,'popup','height=255,width=250,top=250,left=500,modal');
var variable = location.search.substr("?bt=".length);
alert(variable);
return true;
}
catch (e)
{
alert("Exception : problem modal");
return false;
}
}
}
</script>
<body>
<form name="testForm">
<!--<input type="text" id="texte">-->
<input type="button" value="Afficher" onClick="javascript: afficheModal()">
</form>
</body>
</html> |
Partager