Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>AJAX</title>
- <script>
- function ajax1() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if(this.readyState == 4 && this.status == 200)
- document.getElementById("res").innerHTML = this.responseText;
- }
- xhttp.open("GET", "ajax1.txt", true);
- xhttp.send();
- }
- function ajax2() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if(this.readyState == 4 && this.status == 200)
- document.getElementById("res").innerHTML = this.responseText;
- }
- xhttp.open("GET", "ajax2.txt", true);
- xhttp.send();
- }
- </script>
- </head>
- <body>
- .A.J.A.X.
- <div style="font: size 48">
- <label onmouseover="ajax1()"> A </label>
- <label onmouseover="ajax2()"> B </label>
- </div>
- <div id="res"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement