Hi all,
My html source is:
timeAj.html
[CODE=html]<html>
<body>
<script type="text/javascript">[/code]
[code=javascript]function ajaxFunction()
{ var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest( );
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject(" Msxml2.XMLHTTP" );
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(" Microsoft.XMLHT TP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onready statechange=fun ction()
{
if(xmlHttp.read yState==4)
{
document.myForm .time.value=xml Http.responseTe xt;
}
}
xmlHttp.open("G ET","time.asp", true);
xmlHttp.send(nu ll);
}[/code]
[code=html]</script>
<form name="myForm">
Name: <input type="text"
onkeyup="ajaxFu nction();" name="username" />
Time: <input type="text" name="time" />
</form>
</body>
</html>[/code]
and asp page is:
time.asp
...........
[CODE=asp]<%
response.expire s=-1
response.write( time)
%>
[/CODE]
But i cant call.time.asp into the main page...
I am new in Ajax...
Please help me...
Regards,
Mathew
My html source is:
timeAj.html
[CODE=html]<html>
<body>
<script type="text/javascript">[/code]
[code=javascript]function ajaxFunction()
{ var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest( );
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject(" Msxml2.XMLHTTP" );
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(" Microsoft.XMLHT TP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onready statechange=fun ction()
{
if(xmlHttp.read yState==4)
{
document.myForm .time.value=xml Http.responseTe xt;
}
}
xmlHttp.open("G ET","time.asp", true);
xmlHttp.send(nu ll);
}[/code]
[code=html]</script>
<form name="myForm">
Name: <input type="text"
onkeyup="ajaxFu nction();" name="username" />
Time: <input type="text" name="time" />
</form>
</body>
</html>[/code]
and asp page is:
time.asp
...........
[CODE=asp]<%
response.expire s=-1
response.write( time)
%>
[/CODE]
But i cant call.time.asp into the main page...
I am new in Ajax...
Please help me...
Regards,
Mathew
Comment