Hi, If some one can guide me to the right direction I'm trying to use arrays to display urls in one line and under the url the text name of the href text. The second function it doesnt work some help will appreaciated.
thank you.
<!DOCTYPE HTML>
<head>
<meta http-equiv="content-type" content="text/html" />
<meta name="author" content="lolkittens" />
<title>Untitled 2</title>
<script type="text/javascript">
url_list = new Array(
["Link name google","http://www.google.com"],
["Link name yahoo","http://www.yahoo.com"],
["Link name msn","http://www.msn.com"]
);
link_text = new Array(
["Link TEXT:name google","http://www.google.com"],
["Link2 TEXT: name yahoo","http://www.yahoo.com"],
["Link3 TEXT:name msn","http://www.msn.com"]
);
function link(){
var seed=Math.floor(Math.random() * url_list.length);
document.getElementById("url1").href = url_list[seed][1];
document.getElementById("url1").innerHTML = url_list[seed][0]; setTimeout('link()',1000);}
function link2(){
var seed=Math.floor(Math.random() * link_text.length);
document.getElementById("url2").href = link_text[seed][1];
document.getElementById("url2").innerHTML = link_text[seed][0]; setTimeout('link()',1000);}
function init() {
link();
link2();
}
</script>
</head>
<body>
<script type="text/javascript">
window.onload=init;</script>
<a href="#" id="url1"></a><br />
<a href="#" id="url2"></a>
</body>
</html>