4 Sep
2011
4 Sep
'11
8:14 p.m.
On Sep 4, 2011, at 11:50 AM, Alex Tang wrote:
I've successfully deployed two apps using two different virtual hosts, however in this case, the frontend app sends pages back to the browser that contain AJAX requests that want to talk directly to the backend app. I can't do this via two different virtual hosts due to same-origin-policy, so i need to deploy both apps under the same virtual host
Consider using JSONP. That way you can have two separate virtual hosts communicating with Ajax, no problem. This will also give you the flexibility to move one or the other app to a different web server if and when the need arises. JSONP was invented for this very reason, to get around the same origin policy.