cross domain load of data
I've been getting to grips with jQuery, mostly with PHP, on my own site and loving it, so trying to use it in a new project I am working on.
Basically, I have some content loaded onto a clients server and when it launches it gewts the users previous data from my server. So, to get the initial user data, the page on their server makes a jQuery call to my server to get the users previous progress.
My problem is that both servers are different domains, and I am getting warnings about the page accessing information beyond it's control. I want to avoid this if at all possible. I had thought that jQuery supported cross domain loading of data so my questions are -
1. Am I correct I can load data from a different domain (without needing to make server modifications on the clients server)?
2. How do I do it - presuming what I have done is wrong (shown below roughly)?
Thanks a lot!
Andy
- <script language="JavaScript" src="../jscripts/jquery-1.4.2.min.js"></script>
<script language="JavaScript">
- var remoteaddress="http://www.xxxxxxx.com";
- var userID="abcdefg";
- var contentID="item36";
- function getusersupdate(){
callAddress = remoteaddress+"/adminpages/getUsersData.asp?userid="+userID+"&contentID="+contentid;
$.get(callAddress, updateuserdata);
}
function updateuserdata(data){
alert(data);
//do stuff with the data
- }
- $(document).ready(getusersupdate);