Skip to main content

Posts

Showing posts with the label Ajax Event

Ajax Event

(1)Ajax  Onclick Event Example: <!DOCTYPE html> <html> <body> <div id="demo"> <h1>The XMLHttpRequest Object</h1> <button type="button" onclick="loadDoc()">Change Content</button> </div> <script> function loadDoc() {   var xhttp = new XMLHttpRequest();   xhttp.onreadystatechange = function() {     if (this.readyState == 4 && this.status == 200) {       document.getElementById("demo").innerHTML =       this.responseText;     }   };   xhttp.open("GET", "ajax_info.txt", true);   xhttp.send(); } </script> </body> </html> (2) Ajax  onmouseover  Event: <!DOCTYPE html> <html> <body> <div id="demo"> <h1>The XMLHttpRequest Object</h1> <button type="button" onmouseover="loadDoc()">Change Content</button> </div> <script> func...