title: AngularJS and Phonegap Cross Origin Access
body: <p>Recently i created a PhoneGap App for mobile devices, using AngularJS as javascript framework.</p>
  
  <p>I have a PHP backend serving Restful JSON data, build in Laravel PHP Framework.</p>
  
  <p>The PhoneGap App requests data from my PHP Server with the $http service in AngularJS, and it works perfectly on my mobile phone.</p>
  
  <p>Now i wanted to make my PhoneGap App available on a website temporarily instead of in an App.
  So i moved my PhoneGap project to a webserver, but here it doesnt work at all.
  I get these errors when trying to use the webapp in my own browser.</p>
  
  <blockquote>
    <p>"Origin <a href="http://somewebsite.com" rel="nofollow">http://somewebsite.com</a> is not allowed by Access-Control-Allow-Origin.".</p>
  </blockquote>
  
  <p>I tried to add some config parameters to AngularJS such as:</p>
  
  <blockquote>
    <p>delete $httpProvider.defaults.headers.common['X-Requested-With'];</p>
  </blockquote>
  
  <p>But nothing seems to help.</p>
  
  <p>I find it kinda weird that it worked as a PhoneGap app on my phone and in my iPhone Emulator, but it doesnt work on my new webserver domain.</p>
  
  <p>Anyone know what to do?</p>