title: XMLHttpRequest cannot load.... Origin null is not allowed by Access-Control-Allow-Origin
body: <p>I am trying to print a json that this broker on my server, but i can not return the json, the chorme me of the following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest can not load .... Origin null is not allowed by Access-Control-Allow-Origin.</p>
  </blockquote>
  
  <p>can someone help me?</p>
  
  <p>the following code:`</p>
  
  <pre><code>console.log("carregando..");
  var username = "admin";
  var password = "password";
  $.ajax({
  
     type: 'GET',
      url: 'http://localhots/api/json/broker/dest-metrics',
      dataType: 'json',
      headers : {Accept : "application/json","Access-Control-Allow-Origin" : "*"},
      beforeSend : function(req) {
                                      req.setRequestHeader('Authorization', "Basic " +Base64.encode(username+":"+password))
                                      console.log("Autenticado!!");
      },
      success: function(data) { console.log("Sucesso!!"); },
      error: function (data) {
                console.log("ERRO");
           },
      data: {},
     async: false,
     cache: false,
     jsonp: true 
  
  
  
  });`
  </code></pre>