Using a Proxy Server Script
It is quite clear that unless you are building a solution where you can control the environment, such as ensuring that your users use Internet Explorer or Firefox (in which case you would need to sign your scripts or configure the browsers manually to be more permissive), accessing remote servers from your JavaScript code is not an option.
The very good news is that the workaround is simple; instead of having the JavaScript access the remote server directly you can have a PHP script on your server that will access the remote server on behalf of the client. This technique is described in the following figure:
To read data from a remote server with PHP we will use the file_get_contents
function, whose documentation can be found at http://www.php.net/manual/en/function.file-get-contents.php.
Note
A popular (and more powerful) alternative to using file_get_contents
is a library called Client URL Library (CURL...