par
Invité » 18 août 2005, 16:07
var newWin = null;
function closeWin(){
if (newWin != null){
if(!newWin.closed)
newWin.close();
}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,
height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}
j'ai trouvé ce code : où dois-je mettre cette fonction dans mes pages php?
ensuite, il me suffit d'appeler la fonction sur ma page où j'ai mon lien:
<head>
<script type="text/javascript" src="pop.js"></script>
</head>
<body>
<a href="ma_fenetre.htm"
onclick="popUp(this.href,'console',400,200);return false;">Lien vers une nouvelle fenêtre</a>
</body>
et c'est censé marcher si j'ai bien compris ? mais il me di ke g une erreur sur cette ligne
var newWin = null;
je ne comprend pas...
en tout cas, merci chacun pour votre aide, c'est pas que je rame, mais bon....en fait si

[color=olive]var newWin = null;
function closeWin(){
if (newWin != null){
if(!newWin.closed)
newWin.close();
}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,
height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
} [/color]
j'ai trouvé ce code : où dois-je mettre cette fonction dans mes pages php?
ensuite, il me suffit d'appeler la fonction sur ma page où j'ai mon lien:
[color=olive]<head>
<script type="text/javascript" src="pop.js"></script>
</head>
<body>
<a href="ma_fenetre.htm"
onclick="popUp(this.href,'console',400,200);return false;">Lien vers une nouvelle fenêtre</a>
</body> [/color]
et c'est censé marcher si j'ai bien compris ? mais il me di ke g une erreur sur cette ligne
[color=red]var newWin = null;[/color]
je ne comprend pas...
en tout cas, merci chacun pour votre aide, c'est pas que je rame, mais bon....en fait si #-o