Below is the code in my asp page
Ajax.asp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ajax.asp</title>
<script type="text/javascript">
function Delay(SECOND)
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest(); }
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
alert(xmlHttp.responseText);
}
}
xmlHttp.open("GET","Delay_Page.asp?SECOND="+SECOND,true);
xmlHttp.send(null);
return true
}
</script>
</head>
<body>
// below is the button for passing seconds
<input onclick="javascript:return (Delay('30')&& Delay('10')&& Delay('5'));" type="button" value="Button" name="B3">
</body>
</html>
In the Delay_Page.asp this is the code
<%
ss= request.querystring("SECOND")
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
Delay(SECOND)
response.write SECOND &" SECONDS left"
%>
The above code is working fine, but some problems i wants to solve
what i need is
i want to invoke Delay('30')&& Delay('10')&& Delay('5'))
functions together
Now the condition is, when the first function finish Delay('30')
then after only it goes to the second function
Now Total time to finish the function is 45 seconds (30 + 10 + 5)
I need to finish these three functions in 30 seconds
hoping your help plz,