Bonjour,
Je désire savoir comment appeler une fonction écrite dans une page html à partir d'un popup. J'ai utilisé window.opener..nomdelafonction mais ça n'a pas fonctionné.
voilà merci[/i]
Bonjour,
Je désire savoir comment appeler une fonction écrite dans une page html à partir d'un popup. J'ai utilisé window.opener..nomdelafonction mais ça n'a pas fonctionné.
voilà merci[/i]
p1
'p2.html'<html>
<head>
<script language="javascript">
function test()
{
alert("toto");
}
</script>
<body>
<input type="button" onclick="window.open('p2.html')">
</body>
</html>
marche...<html>
<head>
<title>page2</title>
</head>
<body>
<script>
window.opener.test();
</script>
</body>
</html>
La fonction que j'ai utilisé renvoie une valeur booléenne, c'est peut être pour ça que ça n'a pas marché.
if(window.opener.verifMail(window.opener.form1.mail.value))
...
<html>
<head>
<script language="javascript">
function verifMail(tt)
{
return true;
}
</script>
<body>
<form name="form1">
<input type="button" onclick="window.open('p2.html')">
<input name="mail">
</form>
</body>
</html>marche toujours!<html>
<head>
<title>page2</title>
</head>
<body>
<input type="button" onclick="alert(window.opener.verifMail(window.opener.form1.mail.value))">
</body>
</html>
Partager