Conflit entre 2 window.open
Salut à tous,
Un nouveau soucis qui me les :x .......
J'ai les deux fonctions javascript suivantes :
Code:
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
|
<script language="JavaScript">
//Popup pour la recherche sur les métiers
function ouvreFenetreFct(nomPage){
//Pour centrer la fenêtre
var posTop=(screen.height-100)/2;
var posGauche=(screen.width-400)/2;
if(!window.fenetreLieu) {
window.fenetreFct = window.open(nomPage,
'top='+posTop,
'left='+posGauche,
'width=400 , height= 100, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, menubar=no');
}
else
alert('Fermez l\'autre fen\352tre svp');
}
//Popup pour la recherche de la commune/Code Postal
function openWindowLieu(pageName){
//Pour centrer la fenêtre
var positionTop=(screen.height-100)/2;
var positionGauche=(screen.width-400)/2;
if(!window.fenetreFct) {
window.fenetreLieu = window.open(pageName,
'top'=+positionTop,
'left='+positionGauche,
'width=400 , height= 100, resizable=no, location=no, menubar=no, status=no, scrollbars=yes, menubar=no');
}
else
alert('Fermez l\'autre fen\352tre svp');
}
</script> |
J'ai mis des conditions pour tester si l'une ou l'autre était ouverte, en vain...
Si je mets en commentaire un des deux window.open, cela fonctionne (vérifié en mettant un alert dans le corps de la fonction).
Si vous avez la solution, je vous en serai bien reconnaissant !
Merci d'avance.