Explorar el Código

第一次提交ajax

suixin hace 2 años
commit
fc1b7a1681
Se han modificado 1 ficheros con 20 adiciones y 0 borrados
  1. 20 0
      ajax.html

+ 20 - 0
ajax.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <script>
+        var xhr=new XMLHttpRequest();
+        var url="./server/tables/users.json";
+        xhr.open('get',url,true);
+        xhr.onload=function(){
+            console.log(xhr.responseText)
+        }
+        xhr.send();
+    </script>
+</body>
+</html>