1. Using frameworks. One of the popular solutions is to use some of the nice frameworks like jQuery that will do the job for you. jQuery supports native crossdomain requests. For more information check this page.
3. Using server's proxy. This is the ideal solution, but of course you have to have an administration access to your server. For example Apache has a module called mod_proxy, which perfectly fits in our needs. The basic idea is to add a rule that will forward your requests from aaa.com to bbb.com.
LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /data http://bbb.com/data
For example if you try to open aaa.com/data/getData.php the server will automatically open http://bbb.com/data/getData.php