AJAX request to a remote domain

Good afternoon everyone.

Like many here, I’m currently writing a system in php.

I needed to get data from another domain. I spied an ajax request in their web interface:

     $.ajax({
          url: '/lenta/get_last_opened_organization',
          success: function( data ){
            $("#last_viewed").html(data)
          }
      });

I took it and inserted it myself with a link to their domain, it turned out like this:

         $.ajax({
              url: 'http://domen/lenta/get_last_opened_organization',
              success: function( data ){
                $("#last_viewed").html(data)
              }
          });

When making a request, the browser told me:

XMLHttpRequest cannot load http://domen/lenta/get_last_opened_organization. Origin http://my-domen.ru is not allowed by Access-Control-Allow-Origin.

I’m not exactly sure why, but access denied.
The question is how to pretend that you are making a request from their domain..

p.s.
Found this in the jQquery AJAX documentation:

Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol.

Does this mean the problem is unsolvable?!


Answer 1, authority 100%

Access to other domains is denied for security reasons. To receive a response from another domain, this same domain must be configured for this in advance. Read this Data exchange between domainsand this JSONP


Answer 2, authority 100%

Make a php script on your server, let ajax access your script, and the script, using curl, access that site, after receiving the result, it will transfer it to your site.


Answer 3, authority 50%

This is called a security policy, there is nothing to roam on other people’s sites.


Answer 4

If I’m not mistaken, then you need to change the current domain to the desired one, document.domain=”, like this, I don’t have an editor at hand.