No, there won't be a straight forward answer to this because it will depend entirely on your system/server setup, and what you have access to. Here's what you need to know.
In the beginning -- AJAX requests had a very strict "same origin" policy. This meant if you made an ajax request FROM a website with the domain example.com
, you could only make a request to a URL that was on example.com
.
In more recent years browsers have loosened up on this. If the server that you're making a request to has an Access-Control-Allow-Origin
header, and that header includes the URL/domain of the server you're making the request from, then the request will be allowed. Similar question/answer here.
So, how you set this header depends on the server you're making a request to. If you have control over this server, start your Googling there.
If you don't have control over this server, you need to make a request to php
page on your server, and this PHP page should make a curl
request to the server that had the information you don't. A curl
request, happening outside the browser, isn't subject to the same cross domain issues.