Google Answers Logo
View Question
 
Q: JavaScript needs to be written ( No Answer,   1 Comment )
Question  
Subject: JavaScript needs to be written
Category: Computers > Programming
Asked by: cmonkey-ga
List Price: $10.00
Posted: 11 Dec 2005 20:25 PST
Expires: 10 Jan 2006 20:25 PST
Question ID: 604635
I need a java script or like script that will:

www.ExampleURL.com/abc?Page=1 
and refreshes and goes through pausing for a few seconds on each page or slide
www.ExampleURL.com/abc?Page=2 
www.ExampleURL.com/abc?Page=3 
www.ExampleURL.com/abc?Page=4.... etc... 

So it will add 1 to the variable number in the url and refresh the
page every few seconds. It will need to do this process about 100,000
times.

I need the completed script.

Clarification of Question by cmonkey-ga on 11 Dec 2005 20:27 PST
It needs to be able to run in internet explorer as well...

Clarification of Question by cmonkey-ga on 11 Dec 2005 20:40 PST
I think the code below would be a good start still missing the base
url with a +1 function though.


<html>
	<head>
		<title>For neutral-ga</title>
		<script language="javascript">
			var urls;
			var order = 0;
			var mywin;
			function rotate()
			{
				if( order < urls.length - 1 )
					order++;
				else
					order = 0;
				mywin.location = urls[order];
				setTimeout('rotate();', document.getElementById("time").value*1000);
			}
			
			function init()
			{
				if( document.getElementById("urls").value.length != 0 )
				{
					urls = document.getElementById("urls").value.split(",");
					mywin = window.open(urls[0], '87931', 'width=' +
screen.availWidth + ', height=' + screen.availHeight + ', screenX=0,
left=0, screenY=0, top=0, toolbar=1, scrollbars=1, location=1,
status=1, menubar=1, resizable=1');
					mywin.focus();
					setTimeout('rotate();', document.getElementById("time").value*1000);
				}
				else
				{
					alert("No url's here");
				}
			}
		</script>
	</head>
	<body>
		URL's: <textarea id="urls" name="urls" rows="5"
cols="40"></textarea> (Comma Separated Variable format with full url,
like '://www.google.com/')<br>
		Time: <input type="text" id="time" name="time"> (seconds)<br>
		<input type="button" value="Visit" onclick="init();">
	</body>
</html>
Answer  
There is no answer at this time.

Comments  
Subject: Re: JavaScript needs to be written
From: guysoffer-ga on 12 Dec 2005 06:22 PST
 
Hi,

Is the page a standard HTML page or some sort of server side script ?
if it is a server side script - a much easier solution is to use a
meta tag to refresh the page:

At the start of the page print out:
<meta http-equiv="refresh" content="2;url=www.ExampleURL.com/abc?Page=1">

where 1 is a parameter to the page and will be increased each time, of course.
The reason I'm suggesting a server side solution is that it is very
simple and does not depend on the users' browser.

Please let me know if you must use a client-side solution.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy