title: XMLHttpRequest cannot load in angularjs
body: <p>I am learning from this <a href="http://www.geeks.gallery/angularjs-how-to-get-data-like-jquery-ajax-from-database-using-php/" rel="nofollow">site</a>.</p>
  
  <p>I use this for an Android application to fetch the PHP data and show the application.           </p>
  
  <p>When I start the web service in AngularJS, Google Chrome gives this error in the console:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://192.168.1.10/android_connect/JsonReturn.php" rel="nofollow">http://192.168.1.10/android_connect/JsonReturn.php</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.  </p>
  </blockquote>
  
  <p>This is my JavaScript code:</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;function GetUsers($scope, $http) {
      // this is where the JSON from api.php is consumed
      $http.get('http://192.168.1.10/android_connect/JsonReturn.php').
          success(function(data) {
              // here the data from the api is assigned to a variable named users
              $scope.users = data;
          });
  }&lt;/script&gt;
  </code></pre>
  
  <p>Then I set the  HTML code:</p>
  
  <pre><code>&lt;div ng-controller="GetUsers"&gt;
  
  &lt;table&gt;
  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Email&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
  &lt;tbody&gt;
  &lt;tr ng-repeat="user in users"&gt;&lt;td&gt;{{user.id}}&lt;/td&gt;&lt;td&gt;{{ user.name }}&lt;/td&gt;&lt;td&gt;{{user.email}}&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/tfoot&gt;&lt;/tfoot&gt;
  &lt;/table&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried all the possible solutions posted, but it doesn't seem to fix the issue in my code.</p>