0

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>
2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by Philippe.Lahaie
0

NO, is not working the second array link_text is not showing the right name of the url when the url_list is changing.

Sorry I did not explain it well.

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.