• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details
Home / Buttons / Random Link Generator 2

Random Link Generator 2

Random Link Generator 2

Are you feeling, I don’t know…. A little random? Then check out this random link generator! It randomly selects a URL from a pre-determined list and sends the user there!

<!– ONE STEP TO INSTALL RANDOM LINK GENERATOR:

   1.  Paste the designated coding into the HEAD of the HTML document  –>

<!– STEP ONE: Copy this code into the HEAD of your HTML document  –>

<HEAD>

<SCRIPT LANGUAGE=”JavaScript”>

<!– This script and many more are available free online at –>
<!– The JavaScript Source!! http://javascriptsource.com –>

<!– 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>

<!– STEP TWO:  Paste this last code into the BODY of your HTML document –>

<BODY>
<CENTER>
<FORM NAME=”myForm”>
<INPUT TYPE=”button” NAME=”myButton” VALUE=”Random link”
onClick=”rand_link()”>
</FORM>
</CENTER>

<p><center>
<font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
by <a href=”https://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>

Buttons

Related Snippets:

  • Window Position
  • Scrolling Text Button

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers