Double liens

Fran6net Messages postés 17 Date d'inscription vendredi 24 décembre 2004 Statut Membre Dernière intervention 12 janvier 2005 - 24 déc. 2004 à 13:59
doudou3158 Messages postés 95 Date d'inscription mercredi 29 juin 2005 Statut Membre Dernière intervention 12 mai 2007 - 24 févr. 2006 à 14:05
Bonjour et joyeux noël!
J'aimerais savoir si par l'intervention du javascript il est possible de faire un double lien!
Je m'explique:

En faite j'aimerais qu'à partir d'un lien sa ouvre 2 liens différents!
Merci...

15 réponses

malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 déc. 2004 à 15:09
Salut,

ben sur ton "lien", tu mets un onClick qui appelle une fonction qui elle, va ouvrir 2 fenetres avec tes 2 URL.
0
Fran6net Messages postés 17 Date d'inscription vendredi 24 décembre 2004 Statut Membre Dernière intervention 12 janvier 2005
24 déc. 2004 à 15:18
Peux-tu me détaillé un peu le truc car je ne travaille pas du tout sur JavaScript! Je bosse seulement sur PHP et MySQL
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 déc. 2004 à 15:53
<script language="JavaScript">
function Aff_URL()
{
window.open("www.monurl1.com", "fenetre1");
window.open("www.monurl2.com", "fenetre2");
}
</script>

[# Mon Lien]

Voir apres ce que tu peux ajouter comme parametres a window.open(), y en a plein (taille de la fenetre, affichage des diverses barres, etc...), cherche sur Google.

Et joyeux Noel aussi :-) Merci.
0
Fran6net Messages postés 17 Date d'inscription vendredi 24 décembre 2004 Statut Membre Dernière intervention 12 janvier 2005
24 déc. 2004 à 16:40
Eh bien un réel remrciement! Et puis si jamais vous avez besoin de PHP - MySQL, je suis là!
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
24 déc. 2004 à 17:56
salut
corection...
euh.. t'as trois arguments à window.open....

ça te permet d'ouvrir des fenêtres en pop-up...

In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy

http://coucou747.hopto.org
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 déc. 2004 à 19:34
Coucou :-)

window.open()

--------------------------------------------------------------------------------

Opens a new window.

Syntax
window.open("URL", "name" [, "windowfeatures"])

"le" 3me argument est facultatif.
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 déc. 2004 à 19:37
Fran6net,

eh beh justement, va sur phpcs, g mis un post pour un echange d'idees. C'est pas pour une aide technique, mais plutot pour une eventuelle astuce :-) Donc si t'as 2mn, lis mon post, et si en plus t'as des idees, je prends tres volontiers!!

Lien vers mon post
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 déc. 2004 à 19:39
Heu recoucou,

ceci dit t'as raison, la forme doit etre surement
window.open("www.monurl1.com", "fenetre1", "");

j'ai jamais essaye sans les parametres facultatifs en fait.
0
Fran6net Messages postés 17 Date d'inscription vendredi 24 décembre 2004 Statut Membre Dernière intervention 12 janvier 2005
25 déc. 2004 à 09:50
Et comment on configure "le" 3ème argument?
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
25 déc. 2004 à 11:02
Tiens, et t'affoles pas, ca a l'air long et complique mais ca ne l'est pas.

open (window object)
Method. Opens a new web browser window.

Syntax
[windowVar = ][window].open("URL", "windowName", ["windowFeatures"])
Parameters
windowVar is the name of a new window. Use this variable when referring to a window's properties, methods, and containership.
URL specifies the URL to open in the new window. See the location object for a description of the URL components.

windowName is the window name to use in the TARGET attribute of a FORM or tag. windowName can contain only alphanumeric or underscore (_) characters.

windowFeatures is a comma-separated list of any of the following options and values:

toolbar[=yes|no]|[=1|0] location[=yes|no]|[=1|0] directories[=yes|no]|[=1|0] status[=yes|no]|[=1|0] menubar[=yes|no]|[=1|0] scrollbars[=yes|no]|[=1|0] resizable[=yes|no]|[=1|0] width=pixels height=pixels
You may use any subset of these options. Separate options with a comma. Do not put spaces between the options. The windowFeatures are:

toolbar creates the standard Navigator toolbar, with buttons such as Back and Forward, if true.
location creates a Location entry field, if true.
directories creates the standard Navigator directory buttons, such as What's New and What's Cool, if true.
status creates the status bar at the bottom of the window, if true.
menubar creates the menu at the top of the window, if true.
scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true.
resizable allows a user to resize the window, if true.
width specifies the width of the window in pixels.
height specifies the height of the window in pixels.
Method of
window object

Implemented in
Navigator 2.0

Description
The open method opens a new Web browser window on the client, similar to choosing New Web Browser from the File menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created.
In event handlers, you must specify window.open() instead of simply using open(). Due to the scoping of static objects in JavaScript, a call to open() without specifying an object name is equivalent to document.open().

windowFeatures is an optional, comma-separated list of options for the new window. The Boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open("", "messageWindow", "toolbar") and open("", "messageWindow", "toolbar=1") both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all Boolean windowFeatures are true by default. If you specify any item in windowFeatures, all other Boolean windowFeatures are false unless you explicitly specify them. After a window is open, you cannot use JavaScript to change the windowFeatures.

You can use open on an existing window, and if you pass the empty string for the URL, you will get a reference to the existing window, but not load anything into it. You can, for example, then look for properties in the window.

Examples
In the following example, the windowOpener function opens a window and uses write methods to display a message:

function windowOpener() { msgWindow=window.open("","displayWindow","menubar=yes") msgWindow.document.write ("<HEAD><TITLE>Message window</TITLE></HEAD>") msgWindow.document.write ("<CENTER> Hello, world! </CENTER>")}
The following is an onClick event handler that opens a new client window displaying the content specified in the file sesame.html. The window opens with the specified option settings; all other options are false because they are not specified.

<FORM NAME ="myform"></FORM>
Notice the use of single quotes (') inside the onClick event handler.

See also
close (window object) method
0
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
25 déc. 2004 à 12:01
alalalalala t'aurais pu traduire...

bon, t'as deux trois exemples sur mon site partie WIKI...

J'ai un peu de ménage a faire sur mon sit, débugage, recodage proprement... enfin fait pas gafe, c'ets moche et mal codé, la prochaine version dsera meilleur...

In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy

http://coucou747.hopto.org
0
Fran6net Messages postés 17 Date d'inscription vendredi 24 décembre 2004 Statut Membre Dernière intervention 12 janvier 2005
25 déc. 2004 à 12:07
Oki merci ! Il est vrai qu'en français c'est beaucoup plus cool!
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
25 déc. 2004 à 12:25
Flemmards!! lol

Bon...

les arguments optionnels :
Les suivants doivent etre egal a : yes ou no, ou alors a 1 ou 0
toolbar : affiche ou non la barre d'outils (historique, favoris etc)
location : affiche ou non la barre d'adresse5yes, no, 1 ou 0)
directories : affiche ou non quelquechose, aucune idee de quoi.
status : affiche ou non la barre de status (en bas a gauche)
menubar : affiche ou non la barre de menu (Fichiers, Edition etc)
scrollbars : affiche ou non les ascenceurs (barre de scrolling sur les cotes et en bas)
resizable : la fenetre peut-elle etre redimensionnee par l'utilisateur (en tiurant avec la souris sur les bords ou les coins)

les 2 parametres suivants sont des chiffres (en pixels)
width : largeur de ta fenetre
height : hauteur de ta fenetre

Exemple:

window.open ("http://www.monsiteamoi.php", "NomDeMaFenetre", "toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=no, resizable=no, width=640, height=480");

J'affiche une fenetre avec uniquement les menus (fichiers, edition etc...), sans barre d'outils, sans directories (donc lol), sans barres de scrolling, sans barre de status, sans barre d'adresse, et que l'utilisateur ne peut pas redimensionner a sa guise. Elle fait 640 pixels de large, et 480 pixels de haut.

Vla.

Facile non? :-)
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
25 déc. 2004 à 12:30
Precision, si tu ne specifies aucun parametre optionnel, ils sont tous mis a "yes" par defaut. Si tu en specifies ne serait-ce qu'un seul, ceux que tu ne specifies pas seront alors a "no" par defaut. Gaffe. (j'avais jamais remarque, mais c'est ce qu'il y a marque ;-) )

Et, enfin, ces parametres sont bien optionnels, donc tu peux te contenter de l'url et du nom (et a ce moment la, la fenetre sera une fenetre normale).

Pour la taille de la fenetre, si tu ne precises rien, elle sera a la taille par defaut du navigateur de ton utilisateur, au moment ou elle s'ouvre, evidemment.
0
doudou3158 Messages postés 95 Date d'inscription mercredi 29 juin 2005 Statut Membre Dernière intervention 12 mai 2007
24 févr. 2006 à 14:05
Bonjour voici une liste plus complete des parametre pour window.open() ainsi que la compatibilité avec les navigateur :

alwaysLowered (nécessite un script signé) : NS4+
alwaysRaised (nécessite un script signé) : NS4+
channelmode (barre d'outils seule) : IE4+
copyhistory (sauvegarder historique) : Toutes versions
dependent (liée à l'opener) : NS4+

directories (barre de liens perso) : Toutes versions <=== tjrs pas compris ce que c'était...

fullscreen (plein écran) : IE4+
height (hauteur) : Toutes versions (à utiliser avec width)
hotkeys (raccourcis clavier) : NS4+
innerHeight (hauteur interne) : NS4+ (à utiliser avec innerWidth)
innerWidth (largeur interne) : NS4+ (à utiliser avec innerHeight)
left (position à partir du bord) : IE4+ (à utiliser avec top)
location (barre d'adresse) : Toutes versions
menubar (barre des menus) : Toutes versions
outerHeight (hauteur externe) : NS4+ (à utiliser avec outerWidth)
outerWidth (largeur externe) : NS4+ (à utiliser avec outerHeight)
resizable (redimensionnable) : Toutes versions
screenX (position à partir du bord) : NS4+
screenY (position à partir du haut) : NS4+
scrollbars (ascenseurs) : Toutes versions
status (barre d'état) : Toutes versions
titlebar (barre de titre) : IE5+, NS4+
toolbar (barre d'outils) : Toutes versions
top (position à partir du haut) : IE4+ (à utiliser avec left)
width (largeur) : Toutes versions (à utiliser avec height)
z-lock (nécessite un script signé) : NS4+

voila j'espere vous avoir aidé.
0
Rejoignez-nous