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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setTimeout not working

Status
Not open for further replies.

MJB3K

Programmer
Joined
Jul 16, 2004
Messages
524
Location
GB
Hi, i have the following code, and can someone tell me why the buildLayout() function isn't called?
Code:
Early in the script is:
if(response == "Login Successful"){
    to = setTimeout(showUpdate(),1000);
}

function showUpdate(){
	document.getElementById("buildStatus").innerHTML = "Building Layout... Please Wait...";
		
	clearTimeout(to);
		
	//build layout for logged in users
		
	setTimeout(buildLayout(),2000);
}
	
function buildLayout(){
	document.getElementById("layoutStatus").innerHTML = "User Panel... Done!";
}
Any ideas??


Regards,

Martin

Computing Help And Info:
 
Put "buildLayout()" in QUOTES inside the setTimeout call.

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
The same should be applied to your showUpdate()/setTimeout() call.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top