La Communauté Webmaster  forum rss


  Forum-webmaster
  Général
  Discussions générales
(Modérateurs: Jey, Dark.Ginger, Lilian, lauryv, ToToMaStEr, Wolf18)
  Que dois-je ajouter à ce javascript ?
« Précédent Suivant »
Pages: [1] Descendre
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
  Auteur  Sujet: Que dois-je ajouter à ce javascript ?  (Lu 1043 fois)
Que dois-je ajouter à ce javascript ?
« sur: le 08-01-2004 a 11:02:02 »
JP
Membre récent
*

Hors-Ligne

Messages: 12



Je suis un lama!

Voir le Profil
Répondre avec citation

Comment devrais-je modifier le javascript suivant pour que les liens apparaissent dans une nouvelle fenêtre ?

Merci d'avance !

************************************


<!-- A coller entre les balises <body> et </body> -->

<FORM>
<SELECT NAME="list" onChange="top.location.href=this.form.list.options[this.form.list.selectedIndex].value">
   <OPTION SELECTED VALUE="http://www.yahoo.fr">Yahoo France
   <OPTION VALUE="http://www.francite.com">Francite
   <OPTION VALUE="http://www.nomade.fr">Nomade
   <OPTION VALUE="http://www.altavista.com">Altavista
   <OPTION VALUE="http://www.excite.com">Excite
   <OPTION VALUE="http://www.infoseek.com">Infoseek
   <OPTION VALUE="http://www.lycos.com">Lycos
   <OPTION VALUE="http://www.magellan.com">Magellan
</SELECT>
</FORM>

Rapporter au modérateur  

Re:Que dois-je ajouter à ce javascript ?
« Répondre #1 sur: le 08-01-2004 a 19:41:51 »
ric
Membre récent
*

Hors-Ligne

Sexe: Male
Messages: 56



jj

Voir le Profil    E-Mail
Répondre avec citation

Essaye cela.

<head>
<script language="javascript">
function ouv_popup() {
window.open(document.formul.list.options[document.formul.list.selectedIndex].value,"fen_calendrier","");
}
</script>
</head>
<body>
<FORM name="formul">
<SELECT NAME="list" onChange="ouv_popup()">

Rapporter au modérateur  
Re:Que dois-je ajouter à ce javascript ?
« Répondre #2 sur: le 09-01-2004 a 00:47:47 »
yacapa
Membre récent
*

Hors-Ligne

Messages: 11





Voir le Profil    WWW
Répondre avec citation

Pour rester dans le meme genre de prog que jp, il suffit juste d'ajouter window.open comme cela:
Code:

<FORM>
<SELECT NAME="list" onChange="window.open(top.location.href=this.form.list.options[this.form.list.selectedIndex].value)">
  <OPTION SELECTED VALUE="http://www.yahoo.fr">Yahoo France
  <OPTION VALUE="http://www.francite.com">Francite
  <OPTION VALUE="http://www.nomade.fr">Nomade
  <OPTION VALUE="http://www.altavista.com">Altavista
  <OPTION VALUE="http://www.excite.com">Excite
  <OPTION VALUE="http://www.infoseek.com">Infoseek
  <OPTION VALUE="http://www.lycos.com">Lycos
  <OPTION VALUE="http://www.magellan.com">Magellan
</SELECT>
</FORM>

Rapporter au modérateur  
Re:Que dois-je ajouter à ce javascript ?
« Répondre #3 sur: le 09-01-2004 a 15:24:15 »
JP
Membre récent
*

Hors-Ligne

Messages: 12



Je suis un lama!

Voir le Profil
Répondre avec citation

Citation de: yacapa le le 09-01-2004 a 00:47:47
Pour rester dans le meme genre de prog que jp, il suffit juste d'ajouter window.open comme cela:
Code:

<FORM>
<SELECT NAME="list" onChange="window.open(top.location.href=this.form.list.options[this.form.list.selectedIndex].value)">
  <OPTION SELECTED VALUE="http://www.yahoo.fr">Yahoo France
  <OPTION VALUE="http://www.francite.com">Francite
  <OPTION VALUE="http://www.nomade.fr">Nomade
  <OPTION VALUE="http://www.altavista.com">Altavista
  <OPTION VALUE="http://www.excite.com">Excite
  <OPTION VALUE="http://www.infoseek.com">Infoseek
  <OPTION VALUE="http://www.lycos.com">Lycos
  <OPTION VALUE="http://www.magellan.com">Magellan
</SELECT>
</FORM>


Merci beaucoup, je vais essayer ça ce soir !

Rapporter au modérateur  
Re:Que dois-je ajouter à ce javascript ?
« Répondre #4 sur: le 09-01-2004 a 20:00:31 »
JP
Membre récent
*

Hors-Ligne

Messages: 12



Je suis un lama!

Voir le Profil
Répondre avec citation

Citation de: yacapa le le 09-01-2004 a 00:47:47
Pour rester dans le meme genre de prog que jp, il suffit juste d'ajouter window.open comme cela:
Code:

<FORM>
<SELECT NAME="list" onChange="window.open(top.location.href=this.form.list.options[this.form.list.selectedIndex].value)">
  <OPTION SELECTED VALUE="http://www.yahoo.fr">Yahoo France
  <OPTION VALUE="http://www.francite.com">Francite
  <OPTION VALUE="http://www.nomade.fr">Nomade
  <OPTION VALUE="http://www.altavista.com">Altavista
  <OPTION VALUE="http://www.excite.com">Excite
  <OPTION VALUE="http://www.infoseek.com">Infoseek
  <OPTION VALUE="http://www.lycos.com">Lycos
  <OPTION VALUE="http://www.magellan.com">Magellan
</SELECT>
</FORM>


J'ai essayé avec la modification que tu as proposé. Mais le problème, c'est que le lien s'ouvre dans une nouvelle page mais aussi dans la fenêtre de mon site ! Moi je souhaite que mon site reste là où il est ! ;o)  Une idée ?

Rapporter au modérateur  
Re:Que dois-je ajouter à ce javascript ?
« Répondre #5 sur: le 09-01-2004 a 20:12:51 »
yacapa
Membre récent
*

Hors-Ligne

Messages: 11





Voir le Profil    WWW
Répondre avec citation

Autant pour moi, j'avais pas fait gaffe. Faut virer top.location.href=
ce qui donne:
Code:

<FORM>
<SELECT NAME="list" onChange="window.open(this.form.list.options[this.form.list.selectedIndex].value)">
  <OPTION SELECTED VALUE="http://www.yahoo.fr">Yahoo France
  <OPTION VALUE="http://www.francite.com">Francite
  <OPTION VALUE="http://www.nomade.fr">Nomade
  <OPTION VALUE="http://www.altavista.com">Altavista
  <OPTION VALUE="http://www.excite.com">Excite
  <OPTION VALUE="http://www.infoseek.com">Infoseek
  <OPTION VALUE="http://www.lycos.com">Lycos
  <OPTION VALUE="http://www.magellan.com">Magellan
</SELECT>
</FORM>

Rapporter au modérateur  
Re:Que dois-je ajouter à ce javascript ?
« Répondre #6 sur: le 10-01-2004 a 09:16:49 »
JP
Membre récent
*

Hors-Ligne

Messages: 12



Je suis un lama!

Voir le Profil
Répondre avec citation

Ok, merci beauoup Yacapa, cette fois ça joue parfaitement !

MERCI

Rapporter au modérateur  
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
Pages: [1] Monter
« Précédent Suivant »
Sauter à: 

Votre statut : Invité
Vous devez être membre pour participer.
 
 
Let’s Encrypt : le certificat SSL gratuit
Tester votre site internet sur différents navigateurs
[WordPress] Des problèmes avec l’administration ?
Rappel : Mettez à jour vos CMS et vos sites E-commerce
Le .fr fête ses 25 années d’existence !
Mesurer votre audience en temps réel avec BubbleStat
Porter réclamation contre Google Panda ?
Zlio n’est plus …
 
 
 
 
 

Copyright (c) Devclic 2002 - 2026 - Tous droits réservés

creation site internet strasbourg