Click to See Complete Forum and Search --> : Can somone make....


Frostbyt3
12-07-2003, 11:11 PM
a script that I replace the URL with to start an event that would click a link every 6 minutes down a list.

ex.

say i have (cant put tags in)

<html><head><title>links</title>
</head>
<body>

<a href="link1">link1</a><br>
<a href="link2">link2</a><br>
<a href="link3">link3</a><br>

</body></html>

and so on...that would come out with

link1
link2
link3

I need a script that would take "Link1" and open a popup going to it's address. then 6 minutes later goto the second link and open it in a popup. and so on.

Please help me if you can make me one. :D

Gollum
12-08-2003, 02:34 AM
I'll start with the popping up bit...

aURL =
[
"http://www.link1.com",
"http://www.link2.com",
"http://www.link3.com",
"http://www.link4.com",
...
];
var nURL = 0;

function showPopup()
{
window.open(aURL[nURL]);

nURL++;
if ( nURL < aURL.length )
window.setTimeout("showPopup();",360000);
}

<body onload="showPopup();">
...

NB: if you want to reuse the same window every time, just stick some name in as the second argument to window.open()

Now, I used an array litteral to specify all the urls. But if you must have them come from link tags then...

function initURLs()
{
var aA = document.body.getElementsByTagName("a");
aURL = new Array;
for ( var i = 0; i < aA.length; i++ )
aURL.push(aA.href);
}

<body onload="initURLs(); showPopup();">