tl,dr:How can I rotate between two different pages in my DIV?
Hi, I am currently using the following code (Thank your internets!) to refresh PageThatGetsRefreshed.asp in a DIV on my page. All of this works famously.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js">
</script>
<script>
$.ajaxSetup ({ cache: false });
var auto_refresh = setInterval(
function()
{
$('#container').load('PagethatGetsRefreshed.asp')}, 10000);
</script>
</head>
<body>
<div id="container">
<font size="4" face="arial" color="grey"> <i>Page </i></font>
</div>
</body>
What I would like to do now is to rotate between two different pages in that DIV. IE,. page1.asp shows for 10 seconds and then changes to page2.asp for 10 seconds then back to page1.asp.
Pretty new to jquery here so I can't for the life of me figure out how I should accomplish this. I believe I should be writing to a global variable somewhere to indicate which page is currently loaded then use IF/Else to load the other page and change the variable but I cant get this to work, Grrrr.
Also, can someone tell me does the script here continue to run so that the var auto_refresh always remains active or is it lost and reinitiated each time the scripts runs?
Thanks Everybody KG