Knowledge Walls
Ammu
Hyderabad, Andhra Pradesh, India
Passcode:
AJAX in Examples of Javascript 1
1058 Views
Example
<!DOCTYPE html>
<head>
    <title> Learning how to access elements from</title>
    <script>
        function validate() {
            ///validation....
            if (ok) {
                then
            }
            else {
                
            }
            
            if (true) {
                loadDoc();
            }
            else {
                return false;
            }
        }
        function loadDoc() {
          var xhttp = new XMLHttpRequest();
          xhttp.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
             document.getElementById("demo").innerHTML = this.responseText;
            }
              
            //500 - internet server error //404 page not found //200 - ok success
          };
          xhttp.open("GET", "students.php", true);
          xhttp.send();
        }
        
        
        /*
        function abc() {
            
        }
        var abc = function() {
            
        };
        
        abc();
        */
        
    </script>
</head>
<body>
   <form action="students.php" method="post">
       Name:<input type="password" name="pwdid" value="">
       <input type="button" onclick="validate()">
    </form>
    
    
    Name:<input type="password" name="pwdid" value="">
    <input type="button" onclick="validate()">
</body>
</html>
Previous Topics
Previous lessons of current book.
Best Lessons of "Javascript 1"
Top lessons which are viewed more times.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details