blababa Posted February 10, 2012 Report Share Posted February 10, 2012 (edited) Olá, sou um pouco novo em JS e gostaria de saber como unir a função aleatório e abrir uma nova janela em pop-up.Obrigado a todos, eu já consegui resolver o problema ^^ Edited February 11, 2012 by blababa Quote Link to comment Share on other sites More sharing options...
0 lobismano Posted February 10, 2012 Report Share Posted February 10, 2012 beleza.<html> <head> <script> function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } var enderecos = new Array('http://www.google.com', 'http://www.terra.com.br') function linkAleatorio() { aleat = Math.random() * enderecos.length aleat = Math.floor(aleat) newPopup(enderecos[aleat]) //window.location=enderecos[aleat] } </script> </head> <body> <a href="java script:linkAleatorio()">LinkAleatorio</a> </body> </html>at. Quote Link to comment Share on other sites More sharing options...
0 blababa Posted February 11, 2012 Author Report Share Posted February 11, 2012 (edited) Muito obrigado, eu já tinha conseguido resolver, mas não tive como postar aqui xD Edited February 11, 2012 by blababa Quote Link to comment Share on other sites More sharing options...
Question
blababa
Olá, sou um pouco novo em JS e gostaria de saber como unir a função aleatório e abrir uma nova janela em pop-up.
Obrigado a todos, eu já consegui resolver o problema ^^
Edited by blababaLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.