And when posting data I had to add
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, 
Content-Type, Accept"); 

Now it seems to work, both

Den måndag 8 juni 2015 kl. 19:25:29 UTC+2 skrev Johan Printz:
>
> Thanks! It's solved! I had to add
> header("Access-Control-Allow-Origin: *");
>
> In my PHP app! Thanks for your help!
> Regards
>
> Den måndag 8 juni 2015 kl. 19:09:10 UTC+2 skrev Johan Printz:
>>
>> Thanks Sander! No we're getting somewhere!
>> Something is wrong.. but how to solve it? This is the content in 
>> console.log
>> XMLHttpRequest cannot load http://www.marknad.se/index.php/io. No 
>> 'Access-Control-Allow-Origin' header is present on the requested resource. 
>> Origin 'http://192.168.2.1:8100' is therefore not allowed access.
>>
>>
>>
>> Den måndag 8 juni 2015 kl. 18:45:52 UTC+2 skrev Sander Elias:
>>>
>>> Hi Johan,
>>>
>>> can you try this in your program:
>>>       $http
>>>         .get('http://www.marknad.se/index.php/io')
>>>         .then(function (resp) {
>>>           console.log(resp)
>>>         })
>>>
>>>
>>> and let us know whats displayed in your developer console?
>>>
>>> Regards
>>> Sander
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to