Thursday 23 February 2012
Made in INDIA
AJAX Basic
AJAX Introduction AJAX Examples
AJAX XMLHttpRequest
Create an XMLHttpRequest Object Send a Request To a Server Server Response The onreadystatechange Event
AJAX Advanced
AJAX PHP Example AJAX PHP with MySql Database AJAX XML File
AJAX Function
2010-09-14 09:09:59 526day
<div id="pic"> </div>
<script type="text/javascript">
function handleHttpResponse() {
if (http.readyState == 4) {
var results=http.responseText;
document.getElementById("pic").innerHTML=results;
setTimeout("AjaxFunction()",3000);
}
}
function AjaxFunction() {
var page="page.php"+"?random="+Math.random();
http.open("GET", page, true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
}
function getHTTPObject() {
var xmlhttp;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp){
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
}
return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object
AjaxFunction();
</script>
|
Anand
2011-02-03 23:02:45 384day
very helpful for those who new in ajax........
|
Add Comments / Scripts