Manjeet
Manjeet
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>
Output
infobizzs.com
AJAX Example Explained
o The AJAX application above contains one div section and one button.
o The div section will be used to display information returned from a server. The
button calls a function named loadXMLDoc(), if it is clicked:
<!DOCTYPE html>
<html>
<body>
</body>
</html>
o Next, add a <script> tag to the page's head section. The script section contains the
loadXMLDoc() function:
<head>
<script>
function loadXMLDoc()
{
.... AJAX script goes here ...
}
</script>
</head>