Home » , , » Cut & Paste Random Link Generator by JavaScript Team

Cut & Paste Random Link Generator by JavaScript Team

Abstract

Random Link Script, randomly chooses between a custom list of url's

Description

This JavaScript will generate a random url by clicking on it. The script that will randomly choose between a specified pool of urls that you customize. The user will be redirected to that url after pressing the button.

Code Snippet
<script> <!-- /* Random link button- By JavaScript Kit (http://javascriptkit.com) Over 300+ free scripts! This credit MUST stay intact for use */  //specify random links below. You can have as many as you want var randomlinks=new Array()  randomlinks[0]="http://freewarejava.com" randomlinks[1]="http://javascriptkit.com" randomlinks[2]="http://dynamicdrive.com" randomlinks[3]="http://cnn.com" randomlinks[4]="http://www.geocities.com"  function randomlink(){ window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)] } //--> </script> <form> <p><input type="button" name="B1" value="Random Link >>" onclick="randomlink()"></p> </form>  <!--Uncomment below to use a regular text link instead <a href="javascript:randomlink()">Random Link</a> -->
Share this article :

0 comments:

Post a Comment

 
Copyright © Online Business - All Rights Reserved
Proudly powered by Blogger