title: Javascript can't retrieve data from my server
body: <p>I'm currently working in eclipse and I'm making a component for Lumira designer in JavaScript. Beforehand I made a function that can write away data to my database (this one worked fine). </p>
  
  <p>Now I'm trying to make a function to fetch this data back from the server. The problem is I try to see my data with an alert or in the console log but everytime I fetch something my alert either doesn't pop up or is empty and the console log is also empty. But when I check my network it always says that everything is fetched and I can see my objects(see picture below). </p>
  
  <p>My question is why can't I see them in my alert or console? You can find my code and an image of the network below</p>
  
  <p><img src="https://i.stack.imgur.com/JALyR.png" alt="network"></p>
  
  <p>Fetch I tried to use:</p>
  
  <pre><code>getButton.on("click", function() {
      fetch('https://xxxxxx/myphpfile.php').then(
          function(response){
              alert(response)
              return response.json();
          }).then(function(jsonData){
              alert(jsonData)
              //handle json data processing here
          });
  </code></pre>
  
  <p>xmlhttprequest I tried before: </p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {
      if (xhr.readyState == XMLHttpRequest.DONE) {
          alert(xhr.responseText)
          var resp = xhr.responseText
          arr = JSON.parse(resp);
          alert(arr);
      }
  }
  xhr.open('GET', 'https://xxxxxx/myphpfile.php', true);
  xhr.send(null);
  </code></pre>