Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var request = new XMLHttpRequest();
  2. request.open('GET', 'do kommt dei url diest in browser einfügst eina inkl. https oder http wenn verfügbar', true);
  3. request.onload = function () {
  4. var jsonData = JSON.parse(this.response);
  5. if (request.status >= 200 && request.status < 400) {
  6.  
  7. //Do sand deine JSON daten jetzt in da variable "jsonData".
  8.  
  9. } else console.log(`Could not connect to JSON-Server! Code: ` + request.status);
  10. };
  11.  
  12. request.send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement