With javascript, getting the file contents from another domain is not allowed in many browsers for security reasons. In php, you'd have to utilize curl.
For a workaround, you can make a php script with curl on your local domain and call that with javascript.