Use two (or more) subdomains. eg. data1.example.com and data2.example.com that correspond to the physical servers.
However, for cross domain to work, you need to set
document.domain which allows the communication between domains:
document.domain = "example.com";
Then, you need your script to fail over between the different servers manually. It is the only way that I know of and has been successful in many installs.