Domain Name Forum  
Domain Name Coupons

Domain Name Forum

Domain Name Appraisals

Expired Domains

Domain Name Tutorials

Parking & Traffic Monetization

Domain Registration Reviews and rating

Domain Name Offers And Requests

Go Back   Domain Name Forum > Web Design & Development > Programming > Legacy and Other Languages
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2011, 03:29 AM
phoniex05 phoniex05 is offline
Junior Member
 
Join Date: Aug 2011
Posts: 3
Default ajax simple data

<%@page import="java.util.Date;"%>
<%
Date d=new Date();
out.println(d.getTime());

%>

<html>
<title>ajax programmming</title>
<body>
<h1> Welcome to Ajax programming </h1>
<script type="text/javascript">
function ajaxFunction()
{
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 doesn't support ajax");
return false;
}
}
}


xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.myform.time.value=xmlHttp.responseText;
}
}
var rnd = Math.random();

var url="time.jsp?id="+Math.random();

xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
</script>

<form name="myform">
Name:<input type="text" Onkeyup="ajaxFunction();" name="username">
Time:<input type="text" name="time">


</form>
</body>
</html>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:59 PM.

| Webmaster Forum | | Domain Name Forum |



Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.