Help...

Discussion in 'JavaScript' started by axxo08, Aug 18, 2008.

  1. #1
    This is a script which directs to random pages.I need those random pages to open in a new window.Please help me

    <SCRIPT LANGUAGE="JavaScript">



    <!-- Begin
    function go_to(url) {
    window.location=url;
    }
    function rand_link() {
    var a;
    a = 1+Math.round(Math.random()*3); // a = random number between 1-3
    if (a==1) go_to("http://bgeffects.javascriptsource.com");
    if (a==2) go_to("http://clocks.javascriptsource.com");
    if (a==3) go_to("http://games.javascriptsource.com");
    }
    // End -->
    </SCRIPT>


    <BODY>
    <CENTER>
    <FORM NAME="myForm">
    <INPUT TYPE="button" NAME="myButton" VALUE="Random link"
    onClick="rand_link()">
    </FORM>
    </CENTER>
     
    axxo08, Aug 18, 2008 IP
  2. Paris Holley

    Paris Holley Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    window.open('http://myurl.com');
     
    Paris Holley, Aug 18, 2008 IP