Hi,
i have a php file on the server, it just prints random numbers.
And i want to get this numbers by using XMLHttpRequest
from another domain.
how can i do this?
thanks
Hi,
i have a php file on the server, it just prints random numbers.
And i want to get this numbers by using XMLHttpRequest
from another domain.
how can i do this?
thanks
You can't.
XHR is subject to the same origin policy. There is ongoing work to design and implement systems to allow cross-domain XHR, but the current state of those (the lack of browser support in particular) make it impractical for any real project.
The usual method to work around this is to implement the system using JSON-P instead of XHR.