Mark van Driel 8 years ago
parent
commit
6c6b441642
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      examples/client.html

+ 6
- 5
examples/client.html View File

@@ -4,11 +4,11 @@
4 4
 <script>
5 5
 var xhttp = new XMLHttpRequest();
6 6
 xhttp.onreadystatechange = function() {
7
-  if (this.readyState == 4 && this.status == 200) {
8
-    console.log(this.responseText);
9
-    jsonObject = php_crud_api_transform(JSON.parse(this.responseText));
10
-    document.getElementById('output').innerHTML = JSON.stringify(jsonObject, undefined, 4);
11
-  }
7
+	if (this.readyState == 4 && this.status == 200) {
8
+		console.log(this.responseText);
9
+		jsonObject = php_crud_api_transform(JSON.parse(this.responseText));
10
+		document.getElementById('output').innerHTML = JSON.stringify(jsonObject, undefined, 4);
11
+	}
12 12
 };
13 13
 xhttp.open("GET", "http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1", true);
14 14
 xhttp.send();
@@ -18,3 +18,4 @@ xhttp.send();
18 18
 <pre id="output"></pre>
19 19
 </body>
20 20
 </html>
21
+

Loading…
Cancel
Save