...

View Full Version : Quick simple question, a little complicated for me. Windows.



mb116
01-12-2007, 01:50 AM
Hello all, I am new to the forum and I have a couple quick questions. I need a script that upon opening a page will use the onLoad function to open another window automatically. This window should be opened within a few seconds of this page loading. But thats not the important part. It could be a clickable link on the page.

The page that opens needs to open and then be reloaded over and over continuously. I would like the page to open, wait about 5 seconds and then reload the same page. I need it to do that 5 times and then change to a different url, and then back to the original one.

Here is a visual example if I made it sound to complicated, I tend to do that...

1. Open the source page...
2. The source page opens the child page automatically or by clicking a link.
3. The child page opens with a url of something like... www.yahoo.com
4. Waits 5 seconds and reloads that page.
5. Does this 5 times.
6. Opens a new url in that window... www.msn.com.
7. and then starts all over again, I would like it to be for a set amount of time, being able to set it for 3 or 4 hours or something would be great.

My first idea was to do all of this in seperate windows but then it hit me that this method would probably be a lot easier to design and less of a stress on the computer.

If anyone can offer advice on how to get my going I would really appreciate, if someone is willing to make eacxtly what I need for a small fee I could live with that, save me a bunch of headaches, I need it as soon as possible.

Here is what I have so far. Rough I know... haha

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
reloadtime = 5;

function Start(URL) {
preview = window.open(URL, "preview", windowprops);
if (reloadtime) setTimeout("preview.reload();", reloadtime*1000);
}

function Pop() {
url = "page needs to be opened five times";
delay = 2; // time in seconds before popup opens
timer = setTimeout("Start(url)", delay*1000);
}
// End -->
</script>

</head>

<BODY OnLoad="Pop();">

I got this script off the internet and have been trying to modify it to fit my needs. Thanks for the help guys I really appreciate it.

salmancode
01-12-2007, 09:03 AM
I can write a solution

cost = 5$

regards

salman

supersalman@gmail.com

Mr J
01-13-2007, 10:32 AM
Salmancode
You want the Paid work offers and requests section


Not the finished item but it should get you on your way


<HTML>
<HEAD>
<TITLE>Document Title</TITLE>

<script type="text/javascript">
<!--


urls=[

"http://www.yahoo.com",
"http://www.msn.com"

]

reloadtime = 5

index=0
count=0
preview=null

function start(){
if(!preview){
preview = window.open(urls[index], "preview","left=200,top=100,width=500,height=500")
}

if(preview&&!preview.closed){
preview.location=urls[index]

if(count!=5){
timer=setTimeout("start()", reloadTime*1000)
}

if(count==5){
if(index<urls.length-1){
index++
}
else{
index=0
}

count=0
preview.location=urls[index]
start()
}

count++
}

}


// -->
</script>

</HEAD>
<BODY onload="start()">

</BODY>
</HTML>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum