Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3751 connectés 

 


Dernière réponse
Sujet : [Javascript] besoin de conseil
rufo

Citation :

window.open('+url+','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}


 
C'est clair, y'a un pb avec le "'+url+'";)


Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
rufo

Citation :

window.open('+url+','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}


 
C'est clair, y'a un pb avec le "'+url+'";)

kfman Et comme ça ?
 

Code :
  1. <script language="JavaScript">
  2. function openWindow(url,width,height) {
  3. x = (640 - width)/2, y = (480 - height)/2;
  4. if (screen) {
  5. y = (screen.availHeight - height)/2;
  6. x = (screen.availWidth - width)/2;
  7. }
  8. if (screen.availWidth > 1800) { 
  9. x = ((screen.availWidth/2) - width)/2; 
  10. window.open(url,'newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
  11. }

The Real Phoenix [:totozzz]  
 
ca c'est sur prog plutot...
popgael voila j'ai trouvé un javascript qui permet d'ouvrire un pop-up d'une url intégrée dans le javascript tout en pouvant parametrer la taille du pop-up:
 
<script language="JavaScript">
function openWindow(width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
if (screen.availWidth > 1800) {  
x = ((screen.availWidth/2) - width)/2;  
}  
window.open('lien a ouvrire dans le pop up','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
 
 
 
mais je voudrais integrer en plus des parametre "height" et "width" le parametre "url" pour pouvoir utiliser le javascript avec plusieurs urls sans toucher a la base du javascript donc, j'ai fais ca mais ca ne marche pas qqun a une idée ?
 
 
<script language="JavaScript">
function openWindow(url,width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
if (screen.availWidth > 1800) {  
x = ((screen.availWidth/2) - width)/2;  
}  
window.open('+url+','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)