Tweet

Friday, 2 December 2011

What is AJAX.?


AJAX = Asynchronous JavaScript and XML.
AJAX is a technique for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.
Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.
Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs.


Hello Friends Do You Wanna See The Ajax Magic.....!!!!!
What Is Ajax Magic???
How Does Ajax Magic Work???
How Can I Do Ajax Magic ????!!!!
No Problem This Is The Code Of Ajax Magic ….
OK.
What You Should Do Is To Just Copy And Paste The Script Between In The <HEAD></HEAD> In HTML Form Like This.

<script type="text/javascript">
function update(str){
    var xmlhttp;
                   if(window.XMLHttpRequest){
                      xmlhttp = new XMLHttpRequest();
                   }else{
                      xmlhttp = new ActiveXObject("microsoft.XMLHTTP");
                   }
                   xmlhttp.onreadystatechange = function(){
                       if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
                                     document.getElementById("sField").innerHTML = xmlhttp.responseText;
                                   }
                   }
                   xmlhttp.open("GET","update.php?q="+str,true);
                   xmlhttp.send();
}
</script>
And There Is A One More Step Of  Ajax Magic Is Just Copy And Paste The Below Lines In The <BODY></BODY>.
<input type="text" id="fField" name="fField" onkeyup="update(this.value);"><br /><br/>
<textarea cols="25" rows="5" id="sField"></textarea>

But You Have To save One More File Named As update.php And The Content Is 


<?php
  echo $_REQUEST['q'];
?>



Now Ajax Magic Is Readyyyy!!!!!!!
Run This Code In Your Browser…Just Enjoy And Do Not Forget To Give Your Comments….

No comments:

Post a Comment