1

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?

3 Answers3

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
}

Here's how to navigate to other pages using JS

Here's a quick jQuery intro

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.

https://en.wikipedia.org/wiki/Meta_refresh

Allan
  • 2,889
  • 2
  • 27
  • 38