lien aléatoire + ouverture en popup centrée
Bonjour,
Je suis coincé sur un petit problème, je souhaiterai créer un lien aléatoire (à chaque reload de la page) et qui lorsqu'on clique dessus afficherai le contenu du lien dans une fenêtre popup centrée.
Je me suis basé sur un script que j'ai récupéré sur le net, en ayant essayé et j'ai fait quelques modifs, mais celà ne marche pas pour l'ouverture du lien en popup.
Le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <script language="JavaScript" >
var a = Math.random() + ""
var nombre = a.charAt(5)
script = new Array;
script[1] = "<a href='http://www.site.com/page01.htm' onClick=\'window.open(\'this.href\',\'\',\'width=500 height=400\')'>Page01</a>"
script[2] = "<a href='http://www.site.com/page02.htm'>Page 02</a>"
script[3] = "<a href='http://www.site.com/page03.htm'>Page 03</a>"
script[4] = "<a href='http://www.site.com/page04.htm'>Page 04</a>"
script[5] = "<a href='http://www.site.com/page05.htm'>Page 05</a>"
script[6] = "<a href='http://www.site.com/page06.htm'>Page 06</a>"
script[7] = "<a href='http://www.site.com/page07.htm'>Page 07</a>"
script[8] = "<a href='http://www.site.com/page08.htm'>Page 08</a>"
script[9] = "<a href='http://www.site.com/page09.htm'>Page 09</a>"
script[0] = "<a href='http://www.site.com/page10.htm'>Page 10</a>"
var nouveau = script[nombre]
document.write(nouveau);
</script> |
Si quelqu'un à une idée de comment il faudrai faire..
merci[/code]