<html>
<head>
<title>AJAX</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non-JavaScript Browsers
function launchExample(){
var url = "getContentRender.php?message=Hello";
req = GetXmlHttpObject();
if (req==null){
alert ("Browser does not support HTTP Request")
return
}
req.onreadystatechange=processGetContent;
req.open("GET",url,true);
req.send(null);
}
function processGetContent() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("result").innerHTML=req.responseText;
}
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera
xmlHttp=new XMLHttpRequest();
xmlHttp.overrideMimeType('text/xml');
}
catch (e)
{
// IE
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
//Done Hiding-->
</SCRIPT>
</head>
<body>
<button type="button" onclick="launchExample();">Click Me!</button>
<div id="result"><font color="#0000A0"></font><br>
</body>
</html>