Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixing a while loop

Status
Not open for further replies.

Gxp

Technical User
Nov 24, 2004
6
CA
Hi,

I'm a little stump on this.

window.addEventListener("click", timer_reset, true);
timercount = 0;

// **** reset kiosk to initial startup state *********
function kiosk_reset() {
var site = document.getElementById("kioskDefaults").getString("uriReset");
//site = "history_kludge.length = 0;
LastPageVisited = site;
clearTimeout(timer);

ed = document.getElementById("content");
ed.setAttribute("src", site);

ed_main = document.getElementById("progress_text");
ed_main.setAttribute("value", "flip-to:"+site);

history_kludge[0] = site;

if (document.getElementById("bookmarkList") != null) {
dump_bookmarks();
}

if (document.getElementById("uriBarList") != null) {
uribar_list_dump();
}

if (document.getElementById("VKboard_box") != null) {
VKboard_reset();
}

//dump("** history length = " + history_kludge.length + " ***\n");
}


// **** kiosk timer reset 5 min reset********
function timer_reset() {
//dump("***$$$ Timer RESET A *****\n");
//var reset = document.getElementById("kioskDefaults");
var reset_time = document.getElementById("kioskDefaults").getString("defaultResetTime");
if (timercount >= 1) {
clearTimeout(timer);
//dump("********* CLEARED Timer " + timer + " ****\n");
}
timer = setTimeout("kiosk_reset()", reset_time);
timercount = timer
//dump("***$$$ Timer RESET B " + timercount + " *****\n");

}


This function reset the page back to default home page if left idle for 5 minutes. But problem here is it only does it once. Where should I put a simple while loop here so that it will reset it more than once, when the page is left idle? If anyone got any idea, thanks for your help.
 

If you call timer_reset() from within the kiosk_reset() function, would that work?

Obviously, you would not put the line before the clearTimeout line!

Hope this helps,
Dan

 
Hi,

I tried what you said.

Placing time_reset() within kiosk_reset() function and calling kiosk_reset() function first from Eventlistener. This does not work.

Maybe I need to place a while loop somewhere on the Eventlistener itself? Anyhelp's appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top