Saturday, January 19, 2008

Initial step for AJAX

Sample code for getting data from a DIV tag and giving the data to a DIV.

Technologies used:
HTML and Javascript

<html>

<head>

<script>

function value_feed()

{

var temp ="hello";

var value1=document.getElementById("value1").innerHTML;

document.getElementById("value1").style.visibility="visible";

document.getElementById("value2").innerHTML='<b>'+'<font color ="red">'+temp+" "+value1+'</b>'+'</font>';

//document.getElementById("value1").style.visibility="hidden";

}

function hi()

{

setTimeout("value_feed()",4000);

}

</script>

</head>

<body onload="hi()">

<div id="value1">hi how r uklashdskljdskld</div>

<div id="value2"> </div>

</body>

</html>

No comments: