www.webdeveloper.com
Results 1 to 4 of 4

Thread: Random Link Generator a dud =(

  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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.11847 seconds
  • Memory Usage 2,880KB
  • Queries Executed 15 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates