I have 2 static html webpage generated by our production software. I want to make a dashboard to the shopfloor witch periodically change between this two pages. Is it possible with with ajax or javascript?
Asked
Active
Viewed 1,310 times
1
-
please add code or error log – Subin Babu Apr 12 '18 at 10:59
-
@SubinBabu it seems like he's just looking for guidance, i posted a pretty simple answer to his question. It isn't fancy but it should lead him in the right direction. – nulltron Apr 12 '18 at 11:02
-
StackOverflow is not for guidance.If you try something and got an error, then you can seek help for the same. – Subin Babu Apr 12 '18 at 11:05
3 Answers
1
Use the following code in the first file:
<script type="text/javascript">setTimeout(function(){location.href="url.to.the.second.page";},10 * 1000); </script>
and in the second file:
<script type="text/javascript">setTimeout(function(){location.href="url.to.the.first.page";},10 * 1000); </script>

Eriks Klotins
- 4,042
- 1
- 12
- 26
0
Certainly you could do some type of JavaScript setTimeout() or setInterval() call in a Javascript function JS Timing events.
Personally I would probably use jQuery to manage it and do something like
$(document).ready(function(){
setInterval(pageSwitchFunction, millisecondsIntervalToSwitchPages);
});
function pageSwitchFunction(){
// page swtich logic here
}

nulltron
- 637
- 1
- 9
- 25
0
Pure HTML Example
To automatically switch between two web pages put this in between your <head>
tag on one page:
<meta http-equiv="refresh" content="5; url=page1.html">
Put this in between your <head>
tag on the other page:
<meta http-equiv="refresh" content="5; url=page2.html">
5 is the number of seconds to wait before loading the specified URL. Change the URL to fit your pages.

Allan
- 2,889
- 2
- 27
- 38