title: XMLHTTPRequest Error: Synchronous XMLHttpRequest on the main thread is deprecated ... (SoundCloud API)
body: <p>I'm using an <strong>XMLHttpRequest to access SoundClouds</strong> Top Trending Tracks (<a href="https://api-v2.soundcloud.com/charts?kind=trending&amp;genre=soundcloud:genres:all-music&amp;client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=" rel="nofollow noreferrer">https://api-v2.soundcloud.com/charts?kind=trending&amp;genre=soundcloud:genres:all-music&amp;client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=</a>). I can't even get to parsing and all the fun stuff with it, because my console logs this error:    </p>
  
  <pre><code>Synchronous XMLHttpRequest on the main thread is deprecated because of 
  its detrimental effects to the end user's experience. For more help 
  http://xhr.spec.whatwg.org/
  </code></pre>
  
  <p>I spend some time looking for an answer and - <strong>as far as I understand - the problem is some javascript within an request</strong>. So I looked into the SoundCloud API and found this little bit in every track's properties:</p>
  
  <pre><code>... "waveform_url":"https://wis.sndcdn.com/2AVcYzUmENai_m.json" ...
  </code></pre>
  
  <p>So all solutions I've found to similar problems wouldn't work, as I can't change how their API works. Maybe I'm doing something completely wrong and you guys can help.</p>
  
  <p>Here is the complete function which causes the problem (I think):</p>
  
  <pre><code>function initialSearch() {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', "https://api-v2.soundcloud.com/charts?kind=trending&amp;genre=soundcloud:genres:all-music&amp;client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=", false);
      xhr.addEventListener("load", function() {
          initialArray = JSON.parse(xhr.response);
          }, false);
  } 
  </code></pre>
  
  <p>I call it on "DOMContentLoaded" if it changes anything.</p>
  
  <p>Maybe you can help me. Thanks.</p>