Javascript - Link Random / Choosing a random link

Last update on September 1, 2009 10:44 AM by jak58
Published by hyts78

Javascript - Link Random / Choose a random link









The script below creates a hyperlink directing the visitor to an address chosen at random from a list.

The code below is to be inserted between the tag and <HEAD> </ HEAD> to top:

<SCRIPT Language="Javascript">
<!--
function RandomLink()
{
    Url = new Array;
    base = "http://en.kioskea.net/";
    Url[0] = "index.php3";
    Url[1] = "wifi";
    Url[2] = "php";
    Url[3] = "forum/";

    Linkchoice = Math.round(Math.random() * (Url.length+1));
    window.open(base + Url[Linkchoice],'_blank');
}
//-->
</SCRIPT>



The code below is to be inserted in the body of the page (somewhere between the tags and <BODY> </ BODY>) to display the link:

<A Href="#" onClick="RandomLink(); return(false)">RandomLink</A>
Best answers for « Javascript Link Random / Choosing a random link » in :
SKYBLOG - LINKS Show SKYBLOG - LINKS Simple link To create a simple link in a SkyBlog, the syntax to be used is: [a =address link] name chosen for this link [/ a] [a = http: / / en.kioskea.net] kioskea [/ a] Link emphasis To have a link in an emphasis SkyBlog,...
[Javascript]Choosing a link at random Show [Javascript]Choosing a link at random Here below is a script that creates a hyperlink directing visitor to an address chosen at random from a list. The following code is inserted between and tags at the top of the...
Generating random numbers with rand() ShowGenerating random numbers with rand() You may have noticed when using the rand() found in the standard library of C language, you often get unsatisfied by the results, they look the same. For example, when trying 5 random numbers in...
LAN, Internet connection: choosing your router ShowLAN,Internet connection:Choosing your Router Intro Case 1 Case 2 Case 3 Options and features to consider Standards required for a WiFi router New Standards Intro A router comes in the shape of a box connected to your computer....
Choosing the best Wi-Fi channel ShowChoosing the best Wi-Fi channel Wi-Fi channel Wi-Fi is a wireless network technology with a limited part of the bandwith to limit the noise of other equipment. Here is the list of channels (frequencies associated) of the ISM...
Download Random Number Generator Pro ShowRandom Number Generator Pro is a tool that generates a list of random numbers based on customizable criteria. You can choose the minimum and maximum limits and incrementing numbers. Limits can be positive or negative values. Advantage The...
Random access memory (RAM or PC memory) ShowTypes of random access memory There are generally two broad categories of random access memory: DRAM memories (Dynamic Random Access Module), which are inexpensive. They are used essentially for the computer's main memory SRAM memories (Static...
Linking two PCs with a null modem cable ShowLinking two computers without network cards The best way to link two computers is to use an RJ45 cable to connect the machines' network cards. However, when one or both of the computers has no network card, there is still a fairly easy way to...
The Wi-Fi link layer ShowData link layer The data link layer of the 802.11 standard is composed of two sublayers: the Logical Link Control layer (or LLC for short), and the Media Access Control layer (or MAC). The MAC layer defines two different access methods: The...