Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Automatically Loading Pages

I'm developing an intranet application where the user has no access to the computer, so I need a way of loading pages automatically.  I know of the client pull command, but the problem is I don't own the pages I want to load.  Therefore, I can't edit the pages.  My goal is load approx. 10 unowned,preselected pages, one every ten seconds, without user input.  Then loop back to the first preselected page and continue indefinitly.   All I want the user to see on the screen is the loaded web page.  Is there a way to do this?  Can I use Java scrip? If so how?

0
missle
Asked:
missle
1 Solution
 
pc012197Commented:
There are several ways to do this in JavaScript. In any case you'll have to load a starting page, which you have to write yourself. That page would contain Javascript code to cycle through the other documents.
You could display the other documents in a new browser window, which would be opened by the Javascript program. Or you could split a window into two frames, one of these would contain only your Javascript code (and could therefore be quite small), the other frame would display the pages.

An example:
<html><head><title>startpage</title>
<script>

function initArray() {
      this.length = initArray.arguments.length
      for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
   }

newWin=0;
current=1;
pages=initArray("your://first/url","your://second/url");

function startCycle() {
  newWin=window.open(pages[1], "newWindow" );
  window.setTimeout("doCycle();",10000);
}

function doCycle() {
  newWin.close();
  current = (current % pages.length) + 1;
  newWin=window.open( pages[current], "newWindow" );
  window.setTimeout("doCycle();", 10000);
}
</script>
</head><body onLoad="startCycle();">
This is just a dummy page.
</body>
</html>

I haven't tried this, so there may be a few bugs, but in principle it can be done like this.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now