XLMHTTPRequest ("proper" AJAX) won't work cross-domain. However, as long as you've got less than a total of 2kb (including hostname and path) of data to submit to the server, you can make asynchronous cross-domain requests by dynamically adding (or modifying) SCRIPT tags, like so:
HTML Code:
var args = new Object();
args.width = 500; // or whatever ...
args.height = 300; // or whatever ...
// etc. ...
// turn args into a querystring ...
var nv_pairs = new Array();
foreach (var i in args) {
// you may need/wish to do some URL encoding here as well ...
nv_pairs.push(i + '=' + args[i]);
}
var query_string = nv_pairs.join('&');
var temp_script = document.createElement('script');
temp_script.type = 'text/javascript';
temp_script.src = 'http://yourdomain.com/path/to/script.php?' + query_string;
document.body.appendChild(temp_script);
You can even have your server-side script (script.php in my example) respond with some JavaScript to respond to a callback function, if necessary.
HTML Code:
alert("It worked--hooray!!!");
My apologies if this type of thing has already been posted in this thread--I admittedly skipped a page of posts ...
Anywho ... Good luck!
Bookmarks