Reputation: 23561
I tried to use standard ajax method, to retrieve page content from an URL, however, if I'm not putting this ajax.htm
on a server, e.g apache, and AJAX won't emit.
And if I place it in a http server, trying to access the Internet, it was canceled deliberately, here a screenshot from chromium:
That's weird? Just posting to a virtual machine (192.168.56.212) with AJAX.
P.S: Accessing localhost with AJAX works anyway.
Upvotes: 0
Views: 68
Reputation: 17535
You cant. The browser will usually prohibit connections to any other domain than the one from which the page came. This is called the same origin policy
. There is a way to get around this for some URLs called JSONP, but that only works for sites that use it.
Upvotes: 3