The service your requesting should respond with something like 
Access-Control-Allow-Origin:* in the header. If not then CORS will fail 
like you saw.

To understand this better inspect a request to "http://graph.facebook.com/"; 
using your browsers Dev Tools. You'll see response headers like...


   1. access-control-allow-origin:
   *
   2. cache-control:
   no-store
   3. content-length:
   123
   4. content-type:
   application/json; charset=UTF-
   

Then open up http://www.abc.com, you'll notice the first line is missing.

ps: i'm not able to tell you why your subdomain service works, presumably 
it returns the aforementioned header.

A


On Sunday, January 26, 2014 6:44:35 AM UTC+11, Jayaprakash Harikrishnan 
wrote:
>
> Actually it works within subdomains. but not cross domains.
>>
>
> For example, If I try to access http://foo.bar.com/resource from  
> http://www.bar.com, then it works in IE. But it doesn't work if i try to 
> access from http://www.abc.com
>
> I am unable to find the reason behind this.
>
> Thanks,
> Jayaprakash.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to