www.webdeveloper.com
Results 1 to 4 of 4

Thread: Random Link Generator a dud =(

Hybrid View

  1. #1
    Join Date
    May 2010
    Location
    NYC
    Posts
    7

    Angry Random Link Generator a dud =(

    I used the code on this website http://javascript.internet.com/buttons/r-link.html

    but it doesn't work. I have 167 links and placed the code correctly but nothing. What am I doing wrong?

  2. #2
    Join Date
    Jun 2007
    Posts
    667
    I have 167 links and placed the code correctly but nothing. What am I doing wrong?
    You haven't posted a link to a live example of your correct code, which I hope isn't generating any console errors that you've overlooked.
    Y_U U_G_A_E_U_ B_S_A_D_

  3. #3
    Join Date
    May 2010
    Location
    NYC
    Posts
    7
    It seems to be working now: here is the code (had to shorten it because it was too long)

    Code:
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    
    function go_to(url) {
    window.location=url;
    }
    function rand_link() {
    var a;
    a = 1+Math.round(Math.random()*100);   // a = random number between 1-100
    
    if (a==1) go_to("http://www.snappletop.com/p/1-200.html#76");
    if (a==2) go_to("http://www.snappletop.com/p/1-200.html#83");
    if (a==3) go_to("http://www.snappletop.com/p/1-200.html#127");
    if (a==4) go_to("http://www.snappletop.com/p/1-200.html#176");
    if (a==5) go_to("http://www.snappletop.com/p/1-200.html#177");
    if (a==6) go_to("http://www.snappletop.com/p/601-800.html#673");
    if (a==7) go_to("http://www.snappletop.com/p/601-800.html#674");
    if (a==8) go_to("http://www.snappletop.com/p/601-800.html#677");
    if (a==9) go_to("http://www.snappletop.com/p/601-800.html#678");
    if (a==10) go_to("http://www.snappletop.com/p/601-800.html#679");
    if (a==11) go_to("http://www.snappletop.com/p/601-800.html#681");
    if (a==12) go_to("http://www.snappletop.com/p/601-800.html#683");
    if (a==13) go_to("http://www.snappletop.com/p/601-800.html#684");
    if (a==14) go_to("http://www.snappletop.com/p/601-800.html#685");
    if (a==15) go_to("http://www.snappletop.com/p/601-800.html#688");
    if (a==16) go_to("http://www.snappletop.com/p/601-800.html#690");
    if (a==17) go_to("http://www.snappletop.com/p/601-800.html#691");
    if (a==18) go_to("http://www.snappletop.com/p/601-800.html#692");
    if (a==19) go_to("http://www.snappletop.com/p/601-800.html#694");
    if (a==20) go_to("http://www.snappletop.com/p/601-800.html#695");
    if (a==21) go_to("http://www.snappletop.com/p/601-800.html#696");
    if (a==22) go_to("http://www.snappletop.com/p/601-800.html#698");
    if (a==23) go_to("http://www.snappletop.com/p/601-800.html#700");
    if (a==24) go_to("http://www.snappletop.com/p/601-800.html#701");
    if (a==25) go_to("http://www.snappletop.com/p/601-800.html#706");
    if (a==26) go_to("http://www.snappletop.com/p/601-800.html#708");
    if (a==27) go_to("http://www.snappletop.com/p/601-800.html#710");
    if (a==28) go_to("http://www.snappletop.com/p/601-800.html#711");
    if (a==29) go_to("http://www.snappletop.com/p/601-800.html#713");
    if (a==30) go_to("http://www.snappletop.com/p/601-800.html#714");
    if (a==31) go_to("http://www.snappletop.com/p/601-800.html#715");
    if (a==32) go_to("http://www.snappletop.com/p/601-800.html#716");
    if (a==33) go_to("http://www.snappletop.com/p/601-800.html#718");
    if (a==34) go_to("http://www.snappletop.com/p/601-800.html#719");
    if (a==35) go_to("http://www.snappletop.com/p/601-800.html#720");
    if (a==36) go_to("http://www.snappletop.com/p/601-800.html#722");
    if (a==37) go_to("http://www.snappletop.com/p/601-800.html#723");
    if (a==38) go_to("http://www.snappletop.com/p/601-800.html#724");
    if (a==39) go_to("http://www.snappletop.com/p/601-800.html#725");
    if (a==40) go_to("http://www.snappletop.com/p/601-800.html#727");
    if (a==41) go_to("http://www.snappletop.com/p/601-800.html#728");
    if (a==42) go_to("http://www.snappletop.com/p/601-800.html#729");
    if (a==43) go_to("http://www.snappletop.com/p/601-800.html#731");
    if (a==44) go_to("http://www.snappletop.com/p/601-800.html#732");
    if (a==45) go_to("http://www.snappletop.com/p/601-800.html#735");
    if (a==46) go_to("http://www.snappletop.com/p/601-800.html#737");
    if (a==47) go_to("http://www.snappletop.com/p/601-800.html#740");
    if (a==48) go_to("http://www.snappletop.com/p/601-800.html#741");
    if (a==49) go_to("http://www.snappletop.com/p/601-800.html#743");
    if (a==50) go_to("http://www.snappletop.com/p/601-800.html#744");
    if (a==51) go_to("http://www.snappletop.com/p/601-800.html#745");
    if (a==52) go_to("http://www.snappletop.com/p/601-800.html#747");
    if (a==53) go_to("http://www.snappletop.com/p/601-800.html#748");
    if (a==54) go_to("http://www.snappletop.com/p/601-800.html#752");
    if (a==55) go_to("http://www.snappletop.com/p/601-800.html#753");
    if (a==56) go_to("http://www.snappletop.com/p/601-800.html#754");
    if (a==57) go_to("http://www.snappletop.com/p/601-800.html#756");
    if (a==58) go_to("http://www.snappletop.com/p/601-800.html#757");
    if (a==59) go_to("http://www.snappletop.com/p/601-800.html#759");
    if (a==60) go_to("http://www.snappletop.com/p/601-800.html#760");
    if (a==61) go_to("http://www.snappletop.com/p/601-800.html#761");
    if (a==62) go_to("http://www.snappletop.com/p/601-800.html#762");
    if (a==63) go_to("http://www.snappletop.com/p/601-800.html#764");
    if (a==64) go_to("http://www.snappletop.com/p/601-800.html#767");
    if (a==65) go_to("http://www.snappletop.com/p/601-800.html#768");
    if (a==66) go_to("http://www.snappletop.com/p/601-800.html#769");
    if (a==67) go_to("http://www.snappletop.com/p/601-800.html#771");
    if (a==68) go_to("http://www.snappletop.com/p/601-800.html#772");
    if (a==69) go_to("http://www.snappletop.com/p/601-800.html#774");
    if (a==70) go_to("http://www.snappletop.com/p/601-800.html#775");
    if (a==71) go_to("http://www.snappletop.com/p/601-800.html#776");
    if (a==72) go_to("http://www.snappletop.com/p/601-800.html#777");
    if (a==73) go_to("http://www.snappletop.com/p/601-800.html#778");
    if (a==74) go_to("http://www.snappletop.com/p/601-800.html#782");
    if (a==75) go_to("http://www.snappletop.com/p/601-800.html#783");
    if (a==76) go_to("http://www.snappletop.com/p/601-800.html#786");
    if (a==77) go_to("http://www.snappletop.com/p/601-800.html#788");
    if (a==78) go_to("http://www.snappletop.com/p/601-800.html#789");
    if (a==79) go_to("http://www.snappletop.com/p/601-800.html#790");
    if (a==80) go_to("http://www.snappletop.com/p/601-800.html#791");
    if (a==81) go_to("http://www.snappletop.com/p/601-800.html#794");
    if (a==82) go_to("http://www.snappletop.com/p/601-800.html#795");
    if (a==83) go_to("http://www.snappletop.com/p/601-800.html#797");
    if (a==84) go_to("http://www.snappletop.com/p/601-800.html#799");
    if (a==85) go_to("http://www.snappletop.com/p/801-1000.html#803");
    if (a==86) go_to("http://www.snappletop.com/p/801-1000.html#805");
    if (a==87) go_to("http://www.snappletop.com/p/801-1000.html#806");
    if (a==88) go_to("http://www.snappletop.com/p/801-1000.html#814");
    if (a==89) go_to("http://www.snappletop.com/p/801-1000.html#815");
    if (a==90) go_to("http://www.snappletop.com/p/801-1000.html#816");
    if (a==91) go_to("http://www.snappletop.com/p/801-1000.html#818");
    if (a==92) go_to("http://www.snappletop.com/p/801-1000.html#819");
    if (a==93) go_to("http://www.snappletop.com/p/801-1000.html#820");
    if (a==94) go_to("http://www.snappletop.com/p/801-1000.html#822");
    if (a==95) go_to("http://www.snappletop.com/p/801-1000.html#823");
    if (a==96) go_to("http://www.snappletop.com/p/801-1000.html#825");
    if (a==97) go_to("http://www.snappletop.com/p/801-1000.html#826");
    if (a==98) go_to("http://www.snappletop.com/p/801-1000.html#828");
    if (a==99) go_to("http://www.snappletop.com/p/801-1000.html#830");
    if (a==100) go_to("http://www.snappletop.com/p/801-1000.html#832");
    }
    // End -->
    </SCRIPT>
    </head>
    <body>
    <form name="myForm">
    <input name="myButton" value="Random Fact" onclick="rand_link()" type="button">
    </form>
    </body>
    P.S. I'm posting another problem with a different code LOL

  4. #4
    Join Date
    May 2010
    Location
    Brazil
    Posts
    50
    He just moved to here
    "Scripting is the future of the development languages" --Nathan Paulino Campos(me)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles