title: Problem with ajax calling from facebook app
body: <p>I'm using the following code in order to make an ajax call to my server.<br>
  The code makes the call to the server and in return, it gets a list of all the friends that use the same app.</p>
  
  <pre><code>FB.getLoginStatus(function(response) {
    if (response.session) {
          uid = response.session.uid;
          access_token = response.session.access_token;
          $.getJSON(serverLink+"ajax.php?action=getFriendsApp", {token:access_token}
           ,function(data){
           var temp = data;
           if(true){
                  var container = $('#friends_part_main');
                  var fp = $('#friends_part');
                  fp.show();
                  var friends = data;
                  for(var i in friends){
                      container.append('&lt;a target="_blank" href="http://www.facebook.com/profile.php?id='+friends[i]+'"&gt;\n\
                      &lt;img src="https://graph.facebook.com/'+friends[i]+'/picture" alt="friend" /&gt;\n\
                      &lt;/a&gt;');     
                          }
                      }
                  });
              }
  </code></pre>
  
  <p>If I run this code directly from the browser (www.mydomain.com/app) it works.<br>
  But when I run it from the canvas page (app.facebook.com) I get the foloowing error:  </p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load
    <a href="http://www.mydomain.com/src/ajax.php?action=getFriendsApp&amp;token=AAAC0kxh1WAcBAHo3s0QaVy34mgdnCNGvrDZCvIQsZCBHZC8ovR9IuYEFlUKRqK0GgJosWAD6Embg8QrN07vivE6mOuAZAtxUD7WpySDL3wZDZD" rel="nofollow">http://www.mydomain.com/src/ajax.php?action=getFriendsApp&amp;token=AAAC0kxh1WAcBAHo3s0QaVy34mgdnCNGvrDZCvIQsZCBHZC8ovR9IuYEFlUKRqK0GgJosWAD6Embg8QrN07vivE6mOuAZAtxUD7WpySDL3wZDZD</a>.
    Origin <a href="https://www.mydomain.com" rel="nofollow">https://www.mydomain.com</a> is not allowed by
    Access-Control-Allow-Origin.</p>
  </blockquote>
  
  <p>Can you figure out why??</p>