Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a Random URL script 1

Status
Not open for further replies.

panamajack

Technical User
Dec 8, 2000
5
US
Ok I have been fighting with this one maybe someone can help me.
This is what I need

1. I have a popup that loads automattically, and I have a stats code in them so I need it to stay open for 10 seconds.

2. Auto-refresh said popup after the 10 seconds.

3. Load a random Page when the popup autorefresh.

Its this possible? I have been trying for days with no luck.

I even when as far as making a popup with a form that automatically submitted itself, and then a random page would load, but that didnt work either.

Either way would work for me ( the autosubmit form or the autorefresh popup )

I would appreciate any help that can be sent my way.

Thanks.
 
1 - do nothing but stay open for a while : setInterval(action, delay) (will fire the action once delay is over)
2 - autorefresh : document.reload()
3 - load a random page : Math.random() returns a random number between 0 and 1 and document.location="url" loads a page

got it ?
in the popup say on the body.onload :
setInterval("your_function()", 1000) [delay is in ms]
and
your_function refreshes the pop up and loads the random page
 
Thanks for replying. Sorry but now I'm really confused
 
Ok this is what I go so far

<script>
function winopen()
{window.open(&quot;document.location=&quot;toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=300&quot;)}
</script>
</head>
<body bgcolor=&quot;#6F7A9E&quot; onLoad=&quot;winopen()&quot;>


Ok I just tried it and it cam back with this erro.

The requested URL /cgi-script/reccomend/document.location= was not found on this server.

Can someone please help. Thanks.
 
you actually wrote &quot;ok now go to this page, this page, this page and that page&quot;
and the browser replies &quot;i don't know where the page : 'this page, this page, this page and that page' is&quot;

i mean, what are you trying to do, what is confusing you ??? you've got the code to open a pop up window, to refresh it, to delay, to call a page, and to get a random value !! what is still missing ???????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top