I am having a hard time with setTimeOut function .Let me show the code first.
Here is my code :-
function submitform(loginUrl, username, password) {
try {
loc = new String(window.location);
document.forms.frm_login.action = junctionUrl;
document.forms.frm_login.username.value = username;
document.forms.frm_login.password.value = password;
document.forms.frm_login.submit();
setTimeout(gotoHomePage,4000);
}
catch (e) {
alert(e.message +"submit form");
}
}
function gotoHomePage()
{
alert("test");
var url = "test.aspx";
window.location=url;
}
But here the gotoHomePage function is not at all triggered after the specified 4 seconds.
What i am doing wrong here.Please suggest .
Any help will be appreciated.
Thanks