-2

i having a problem with getting php file content from other server using ajax

i have tried

$.get('http://ec2-174-129-44-226.compute-1.amazonaws.com/api/views/client.php', function(data, textStatus, jqxhr) {
//
});

from other server

i have call from this domain : http://50.22.194.112/.

But above code doesn't work.

Give proper solution for that

Padmanathan J
  • 4,614
  • 5
  • 37
  • 75
hiren patel
  • 29
  • 2
  • 3

1 Answers1

-1

There is no easy solution to use AJAX data from another domain. The same-origin policy prevents this from happening.

Instead, try to get the contents from another domain by using server side code. With server side code (such as PHP) retrieve the page contents and fetch that file with AJAX.

If you're using PHP, check out PHP.net's documentation on CURL.

Nathan
  • 11,814
  • 11
  • 50
  • 93
Laxman
  • 1,149
  • 2
  • 11
  • 17