title: No 'Access-Control-Allow-Origin' header when using localhost
body: <p>I am having some issue when trying to query a layer in AJAX by using localhost. Here is the code:</p>
  
  <pre><code>var visitAPI = "http://mhclivemap.appsolutrends.net/api/visits?" +
                  "start=" + startDate.value + "&amp;end=" + endDate.value + 
                  "&amp;diagnosis=" + mhc_type_select.options[mhc_type_select.selectedIndex].value;
  
             var heatmapData = [];
  
             $.ajax({      
                  url: visitAPI,
                  dataType: "json",
                  crossDomain:true,
                  success: function (res) {
                      var result = res.visits;
                      var marker;
  
                      for (var i=0; i &lt; result.length; i++) { // iterate thru each element in array
                          for (var j=0; j &lt; result[i].count; j++) { // repeat for count in element
                              marker = new google.maps.LatLng(result[i].lat,result[i].lon);
                              heatmapData.push(marker);                           
                          }
                      };
  
                  },
                  error: function () {
                      alert('unable to load this layer, please try again later');
                  }
              });
  </code></pre>
  
  <p>From this portion of codes, it return me an error message:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load mhclivemap.appsolutrends.net/api/visits?start=2014-03-15&amp;end=2014-04-15&amp;diagnosis=GRP1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin localhost is therefore not allowed access.</p>
  </blockquote>
  
  <p>I wonder what has caused this problem? Is it because of the localhost? If so, what's the solution?</p>
  
  <p>Thanks in advance.</p>