title: Bittrex Api in pure Javascript
body: <p>I am trying to read out the public API of Bittrex in pure Javascript. But I can't get it to work. If I call the <code>coinmakretcap</code> api instead, it does work. I want to read it asynchronous without using any package. Does anybody have some suggestions on how to achieve this?</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var api = "https://bittrex.com/api/v1.1/public/getticker?market=BTC-UBQ"  ;      
  //var api = "https://api.coinmarketcap.com/v1/ticker/dash/?convert=EUR";
  
  function apicall(api) {
  
              xhr = new XMLHttpRequest();
              xhr.open("GET", api, true);
              xhr.onreadystatechange = function() {
                  if (this.readyState == 4 &amp;&amp; this.status == 200) {
                      //obj = JSON.parse(xhr.responseText);
                      obj = xhr.responseText;
                      printanswer(obj);
                  }
              };
              xhr.send();
  }
  
  function printanswer(obj) {
      document.getElementById("demo").innerHTML += obj;
  }
  
  apicall(api);
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>